|시간 제한||메모리 제한||제출||정답||맞힌 사람||정답 비율|
|1 초||128 MB||0||0||0||0.000%|
A tunnel with square profile consists of (n-1) sections. Floor in each section is flat and can go up or down along the section. Coordinates [x1, y1], [x2, y2], ..., [xn, yn] where x1< x2< ... < xndescribe points where tunnel’s floor starts, ends, or one section joins other. Ceiling of the tunnel is 1 meter above the floor and corresponding sections’ join points are at coordinates [xi, yi+ 1].
Laser beam is directed to the tunnel from its start. To facilitate beam transition through the tunnel light translators could be installed at section boundaries. These translators can retransmit laser emission in necessary direction, moreover retransmitted beam not necessarily starts at the point where coming beam hit the translator.
As soon as light translators could be installed at sections boundaries only, their coordinates can only be x1, x2, ..., xn. Your task is to determine the minimal number of light translators necessary to allow bean transition through the tunnel.
The first line at input contains integer N (2 ≤ N ≤ 1000). Following N lines contain 2 floats each – coordinates xiand yi(-10000 ≤ xi,yi≤ 10000).
The only line at output should contain one integer – the minimal number of light translators necessary.
4 1 1 2 1 3 2 4 1
5 1 1 2 1 3 2 4 1 5 2