Cubicality
A research space satellite has performed n measurements to study a specific functional dependency. To efficiently transmit the experimental results back to Earth, the data must be divided into the fewest possible segments, with the following requirement: within each segment, a polynomial of degree three or less must perfectly fit the measurement results at all points within that segment.
Moreover, the endpoints of these segments must coincide with the points from the original measurements.
Input
The first line provides the number of measurements n (2 ≤ n ≤ 100). The subsequent line contains n pairs of integers, each with an absolute value not exceeding 1000, representing the measurement results. In each pair, the first integer is the argument value, and the second is the corresponding function value at that point. The pairs are ordered by increasing coordinate values, and the distance between consecutive measurement points does not exceed 100. The numbers in the line are separated by at least one space.
Output
Print the minimum number of segments required.