Today 8Mao got some Slime's eggs. And he hatched some Slimes.
But the problem is - the size of each Slime is all different!
For there're N Slimes and 8Mao numbered them from 1 ~ N by their height.
At first these N Slimes stand at a line and without order of height.
8Mao wants them to stand at a line from low to high. But there's a rule, 8Mao only can take one of them to the head of the line each step.
Can you tell 8Mao the minimum steps that he can let Slimes stand from low to high?
This problem contains several cases, ends with EOF.
The first line of each case contains one integer N (1 <= N <= 300, 000) indicates the number of Slimes at the line.
Next follow N lines which each line indicates the height of Slimes in the initial order.
For each case, you should output the minimum steps 8Mao should do.