getNoOfElements function

Get number of elements