Beam in Tunnel
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 [x_1, y_1 ], [x_2 , y_2 ], ..., [x_n , y_n ] where x_1 < x_2 < ... < x_n describe 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 [x_i, y_i + 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 x_1 , x_2 , ..., x_n . Your task is to determine the minimal number of light translators necessary to allow bean transition through the tunnel.
Input
The first line at input contains integer N (2 ≤ N ≤ 1000). Following N lines contain 2 floats each – coordinates x_i and y_i (-10000 ≤ x_i, y_i ≤ 10000).
Output
The only line at output should contain one integer – the minimal number of light translators necessary.