Eliminating Ballons
시간 제한1초메모리 제한1024 MB
왼쪽에서 오른쪽으로 놓인 풍선들이 각기 다른 높이에 있고, 화살은 풍선을 터뜨릴 때마다 높이가 1씩 낮아진다. 모든 풍선을 터뜨리는 데 필요한 최소 화살 수를 구한다.
문제
An enourmous number of balloons are floating about in the Convention Hall after the Awarding Ceremony of the ICPC Subregional Contest. The manager of the Convention Hall is angry, because he will host another event tomorrow and the ballons must be removed. Fortunately this year Carlinhos came prepared with his bow and arrows to pop the balloons.
Also, luckily, due to the air conditioning flow, the balloons are all in the same vertical plane (that is, a plane parallel to a wall), although in distinct heights and positions.
Carlinhos will shoot from the left side of the convention hall, at a chosen height, in the direction of the right side of the Convention Hall. Each arrow moves from left to right, at the height it was shot, in the same vertical plane of the baloons. When an arrow touches a balloon, the baloon pops and the arrow continues its movement to the right, at a height decreased by . In other words, if the arrow was at height , after popping a balloon it continues at height .
Carlinhos wants to pop all balloons shooting as few arrows as possible. Can you help him?
입력
The first line of input contains an integer , the number of balloons (). Since all balloons are in the same vertical plane, lets define that the height of a ballon is given in relation to the -axis and the position of a balloon is given in relation to the -axis. Balloons are numbered from to . Balloon numbers indicate their positions, from leftmost (balloon number ) to rightmost (balloon number ), independent of their heights. The position of balloon number i is different from the position of balloon number , for all . The second line contains integers , where indicates the height of balloon number ( for ).
출력
Your program must output a single line, containing a single integer, the minimum number of arrows that Carlinhos needs to shoot to pop all balloons.