It has a lot of text in the statement for little problem.
The condition you want to count is the number of guys who are already in the right place in the queue.
There are two things then:
determine the right place in the queue, as the place they are is well known :)
tell
Example 1 (yours):
100 80 90
In order it would be 100 90 80
looking at the two side by side
100 80 90 (original)
100 90 80 (in descending order)
And only one matches: 2 will change places
Example 2 (yours):
100 120 30 50
similarly
100 120 30 50
120 100 50 30
And none is in place: 4 will change
Example 3 (yours):
100 90 30 25
100 90 30 25
And these are in the right order
So just sort the notes in descending order, obviously on another vector, and count how many are equal in position.
Of course, equal grades will cause confusion: in general, guys with the same grade should be seen in order of arrival, but there's no way to do that with these data....