Flat Broken Lines
Time limit1sMemory limit128 MB
Given n points, find the minimum number of flat broken lines (each moving right with segment slopes between -1 and 1) needed to cover all points.
Problem
Imagine a Cartesian coordinate system drawn on a sheet of paper. Consider broken lines (polylines) that can be drawn with a single pencil stroke from the left edge of the sheet to the right edge. We additionally require that, for every segment of such a line, the angle between the straight line containing that segment and the axis lies in the range . A broken line that satisfies these conditions is called a flat broken line.
Equivalently, a flat broken line always moves to the right, and every one of its segments has slope between and .
You are given distinct points with integer coordinates. Determine the minimal number of flat broken lines needed to cover all of the points. A point is covered by a line if it lies on that line.

For example, the six points , , , , , can be covered by a minimum of flat broken lines.
Write a program that reads the number of points and their coordinates from standard input, computes the minimal number of flat broken lines needed to cover all the points, and writes that number to standard output.
Input
The first line contains one positive integer (), the number of points. Each of the next lines contains two integers and (, ) separated by a single space, the coordinates of one point. All points are distinct.
Output
Print a single integer: the minimal number of flat broken lines needed to cover all the points.