find the number of elements on the right which are greater than the current element