Find the Border

No attempts yetTime limit2sMemory limit128 MB

Problem

A closed polyline (which may intersect itself) divides the plane into several regions. Exactly one of these regions is unbounded — it is the exterior of the polyline. All of the bounded regions, together with the polyline itself, form the interior (shaded in the figure below). The border of the interior (the bold line in the figure) is itself a polyline, and it encloses exactly the same interior as the original polyline.

To make the border unique (up to its starting vertex), it satisfies all of the following:

  • it has no self-intersections, although it may touch itself at a point;
  • no two adjacent vertices coincide;
  • no two adjacent edges are collinear;
  • while walking along the border, its interior always lies to the left.

For the given polyline, determine how many vertices its border has.

Input

The first line contains an integer nn (3n1003 \le n \le 100) — the number of vertices of the original polyline. Each of the next nn lines contains two integers xix_i and yiy_i (0xi,yi1000 \le x_i, y_i \le 100) — the coordinates of a vertex. All vertices are distinct, no vertex lies in the interior of an edge joining two other vertices, and no two adjacent edges are collinear.

Output

Print a single integer mm — the number of vertices of the border of the interior.