#icpc2014springf. [icpc2014spring_f]Polygon Guards

[icpc2014spring_f]Polygon Guards

MathJax.Hub.Config({ tex2jax: { inlineMath: [["","",""], ["\\(","\\)"]], processEscapes: true }}); blockquote { font-family: Menlo, Monaco, "Courier New", monospace; color: #333333; display: block; padding: 8.5px; margin: 0 0 9px; font-size: 12px; line-height: 18px; background-color: #f5f5f5; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.15); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; white-space: pre; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; }

Problem Statement

You are an IT system administrator in the Ministry of Defense of Polygon Country.

Polygon Country's border forms the polygon with NN vertices. Drawn on the 2D-plane, all of its vertices are at the lattice points and all of its edges are parallel with either the xx-axis or the yy-axis.

In order to prevent enemies from invading the country, it is surrounded by very strong defense walls along its border. However, on the vertices, the junctions of walls have unavoidable structural weaknesses. Therefore, enemies might attack and invade from the vertices.

To observe the vertices and find an invasion by enemies as soon as possible, the ministry decided to hire some guards. The ministry plans to locate them on some vertices such that all the vertices are observed by at least one guard. A guard at the vertex AA can observe a vertex BB if the entire segment connecting AA and BB is inside or on the edge of Polygon Country. Of course, guards can observe the vertices they are located on. And a guard can observe simultaneously all the vertices he or she can observe.

To reduce the defense expense, the ministry wants to minimize the number of guards. Your task is to calculate the minimum number of guards required to observe all the vertices of Polygon Country.


Input

The input is formatted as follows.

NN
X_1X\_1 Y_1Y\_1
:
:
X_NX\_N Y_NY\_N

The first line contains an even integer NN (4leNlt404 \\le N \\lt 40). The following NN lines describe the vertices of Polygon Country. Each of the lines contains two integers, X_iX\_i and Y_iY\_i (1leileN1 \\le i \\le N, lvertX_irvertle1,000\\lvert X\_i \\rvert \\le 1{,}000, lvertY_irvertle1,000\\lvert Y\_i \\rvert \\le 1{,}000), separated by one space. The position of the ii-th vertex is (X_i,Y_i)(X\_i,Y\_i).

If ii is odd, X_i=X_i+1X\_i = X\_{i+1}, Y_ineY_i+1Y\_i \\ne Y\_{i+1}. Otherwise, X_ineX_i+1X\_i \\ne X\_{i+1}, Y_i=Y_i+1Y\_i = Y\_{i+1}. Here, we regard that X_N+1=X_1X\_{N+1} = X\_1, and Y_N+1=Y_1Y\_{N+1} = Y\_1. The vertices are given in counterclockwise order under the coordinate system that the xx-axis goes right, and the yy-axis goes up. The shape of Polygon Country is simple. That is, each edge doesn’t share any points with other edges except that its both end points are shared with its neighbor edges.

Output

Print the minimum number of guards in one line.


Sample Input 1

8
0 2
0 0
2 0
2 1
3 1
3 3
1 3
1 2```

### Output for the Sample Input 1

```plain
1```

* * *

### Sample Input 2

```plain
12
0 0
0 -13
3 -13
3 -10
10 -10
10 10
-1 10
-1 13
-4 13
-4 10
-10 10
-10 0```

### Output for the Sample Input 2

```plain
2```

* * *

### Source Name

[Japan Alumni Group Spring Contest 2014](http://acm-icpc.aitea.net/index.php?2013%2FPractice%2F%BD%D5%A5%B3%A5%F3%A5%C6%A5%B9%A5%C8%2F%B0%C6%C6%E2)

* * *