There was a large mansion surrounded by high walls. The owner of the mansion loved cats so much that he always prepared delicious food for the occasional cats. The hungry cats jumped over the high walls and rushed straight to the rice that was everywhere in the mansion.

One day the husband found some cats lying down in the mansion. The cats ran around the mansion in search of food, hitting and falling. The husband decided to devise a place to put the rice in consideration of the safety of the cats.

<image>

Seen from the sky, the fence of this mansion is polygonal. The owner decided to place the rice only at the top of the polygon on the premises so that the cats could easily find it. Also, since cats are capricious, it is unpredictable from which point on the circumference of the polygon they will enter the mansion. Therefore, the husband also decided to arrange the rice so that no matter where the cat entered, he would go straight from that point and reach one of the rice.

You can meet this condition by placing rice at all vertices. However, it is difficult to replenish the rice and go around, so the master wanted to place the rice at as few vertices as possible. Now, how many places does the master need to place the rice?

Enter the polygon that represents the wall of the mansion as an input, and create a program that finds the minimum number of vertices on which rice is placed. However, the cat shall be able to go straight only inside the polygon (the sides shall be included inside the polygon).



input

The input consists of multiple datasets. The end of the input is indicated by a single zero line. Each dataset is given in the following format:


n
x1 y1
x2 y2
...
xn yn


The number of vertices of the polygon n (3 ≤ n ≤ 16) is given in the first line. The following n lines give the coordinates of the vertices of the polygon. Each of the n lines consists of two integers separated by one space. xi (-1000 ≤ xi ≤ 1000) indicates the x coordinate of the i-th vertex, and yi (-1000 ≤ yi ≤ 1000) indicates the y coordinate of the i-th vertex. The vertices of a polygon are given in such an order that they visit adjacent vertices counterclockwise.

The number of datasets does not exceed 20.

output

For each data set, the number of vertices on which rice is placed is output on one line.

Example

Input

8
0 0
3 2
6 2
8 6
6 5
7 7
0 4
3 4
8
0 0
5 3
5 2
4 1
6 1
8 6
6 4
2 4
0


Output

1
2
//Name: Cats Going Straight
//Level: 4
//Category: テ・ツケツセテ、ツスツ?Geometry
//Note:

/**
 * テ」ツ?凖」ツ?ケテ」ツ?ヲテ」ツ?ョティツセツコテ」ツつ津ィツヲツ凝」ツつ凝」ツ?禿」ツ?ィテ」ツ?古」ツ?ァテ」ツ?催」ツつ凝」ツつ暗」ツ??」ツ?ェテゥツ?づァツつケテ」ツ?ョテァツオツ?」ツつ津ヲツアツづ」ツつ?」ツつ凝」ツ??
 * テ」ツ?づ」ツつ凝ゥツ?づァツつケiテ」ツ?凝」ツつ嘉ィツセツコテ」ツつ津ィツヲツ凝」ツ?ヲテ」ツ??」ツ?」テ」ツ?淌」ツ?ィテ」ツ?催」ツ??ィツヲツ凝」ツ?暗」ツつ凝」ツ?凝ィツヲツ凝」ツ?暗」ツ?ェテ」ツ??」ツ?凝」ツ?古・ツ、ツ嘉」ツつ湘」ツつ凝ァツつケテ」ツ?ッ
 * ティツヲツ姪ァツキツ堙」ツ?古、ツサツ姪」ツ?ョテゥツ?づァツつケjテ」ツつ津ゥツ?堙」ツつ凝ァツ楪ャテゥツ鳴禿」ツ?ァテ」ツ?づ」ツつ凝」ツ??
 * テ」ツ?療」ツ?淌」ツ?古」ツ?」テ」ツ?ヲテ」ツ??」ツ?禿」ツ?ョテ」ツつ暗」ツ??」ツ?ェテ・ツ債甘ァツ崢エテァツキツ堙」ツつ津」ツ?凖」ツ?ケテ」ツ?ヲテ・ツ按療ヲツ個凖」ツ?療」ツ??」ツ?禿」ツつ古」ツ?ィテ・ツ、ツ堙ィツァツ津・ツスツ「テ」ツ?ョティツセツコテ」ツ?ョテ、ツコツ、テァツつケテ」ツつ?
 * ティツソツステ・ツ環?」ツ?療」ツ?淌ヲツ鳴ーテ」ツ?療」ツ??・ツ、ツ堙ィツァツ津・ツスツ「テ」ツ?ォテ・ツッツセテ」ツ?療」ツ??」ツ?凖」ツ?ケテ」ツ?ヲテ」ツ?ョティツセツコテ」ツ?古ィツヲツ凝」ツ?暗」ツつ凝」ツ?凝」ツつ津ァツ「ツコテ」ツ?凝」ツつ?」ツつ凝」ツ??
 *
 * テ」ツつェテ」ツδシテ」ツδ?」ツδシテ」ツ?ッO(N^4)テ」ツ??
 */
#include <iostream>
#include <complex>
#include <vector>
#include <algorithm>

using namespace std;

const double EPS = 1e-4;

typedef complex<double> P;

inline double dot(const P &a, const P &b) {
    return a.real()*b.real() + a.imag()*b.imag();
}

inline double cross(const P &a, const P &b) {
    return a.real()*b.imag() - a.imag()*b.real();
}

inline int cmp(double a, double b) {
    const double diff = a-b;
    if(fabs(diff) < EPS) return 0;
    return diff < 0 ? -1 : 1;
}

bool intersectSS(const P &pa, const P &pb, const P &qa, const P &qb) {
    if(cmp(cross(pb-pa, qa-pa) * cross(pb-pa, qb-pa), 0) >= 0) return false;
    if(cmp(cross(qb-qa, pa-qa) * cross(qb-qa, pb-qa), 0) >= 0) return false;
    return true;
}

bool intersectLS(const P &pa, const P &pb, const P &qa, const P &qb) {
    return cmp(cross(pb-pa, qa-pa) * cross(pb-pa, qb-pa), 0) < 0;
}

P intersection(const P &pa, const P &pb, const P &qa, const P &qb) {
    const double A = cross(pb-pa, qb-qa);
    const double B = cross(pb-pa, pb-qa);
    if(cmp(A, 0) == 0 && cmp(B, 0) == 0) return qa;
    return qa + B/A*(qb-qa);
}

bool in_polygon(const P &p, const vector<P> &polygon) {
    const int N = polygon.size();
    int cnt = 0;
    for(int i = 0; i < N; ++i) {
        const int ni = (i+1) % N;
        P va = polygon[i] - p;
        P vb = polygon[ni] - p;
        if(va.imag() > vb.imag()) swap(va, vb);
        if(cmp(va.imag(), 0) <= 0 && cmp(0, vb.imag()) < 0) {
            if(cmp(cross(va, vb), 0) < 0) ++cnt;
        }
        if(cmp(cross(va, vb), 0) == 0 && cmp(dot(va, vb), 0) <= 0) return true;
    }
    return cnt % 2 == 1;
}

bool can_see(const P &pa, const P &pb, const vector<P> &polygon) {
    const int N = polygon.size();
    if(abs(pa-pb) < EPS) return true;
    vector<P> ps;
    for(int i = 0; i < N; ++i) {
        const int ni = (i+1) % N;
        if(abs(polygon[i]-pb) < EPS) continue;
        //if(abs(polygon[ni]-pb) < EPS) continue;
        if(intersectSS(pa, pb, polygon[i], polygon[ni])) return false;
        if(cmp(cross(pb-pa, polygon[i]-pa), 0) == 0 && cmp(dot(pa-polygon[i], pb-polygon[i]), 0) <= 0)
        {
            ps.push_back(polygon[i]);
        }
    }
    ps.push_back(pa);
    ps.push_back(pb);
    sort(ps.begin(), ps.end(), [pa](const P &p1, const P &p2) {
            return norm(pa-p1) < norm(pa-p2);
            });
    for(int i = 0; i+1 < ps.size(); ++i) {
        if(!in_polygon((ps[i]+ps[i+1])*0.5, polygon)) return false;
    }
    return true;
}

bool solve() {
    int N;
    cin >> N;
    if(!N) return false;

    vector<P> polygon(N);
    for(int i = 0; i < N; ++i) {
        double x, y;
        cin >> x >> y;
        polygon[i] = P(x, y);
    }
    vector<P> new_polygon;
    for(int i = 0; i < N; ++i) {
        const P pa = polygon[i];
        const P pb = polygon[(i+1)%N];
        new_polygon.push_back(pa);
        vector<P> buf;
        for(int j = 0; j < N; ++j) {
            const P pj = polygon[j];
            for(int k = 0; k < j; ++k) {
                const P pk = polygon[k];
                if(!intersectLS(pj, pk, pa, pb)) continue;
                const P ip = intersection(pj, pk, pa, pb);
                buf.push_back(ip);
            }
        }
        sort(buf.begin(), buf.end(), [pa](const P &a, const P &b) {
                return norm(pa-a) < norm(pa-b);
                });
        new_polygon.insert(new_polygon.end(), buf.begin(), buf.end());
    }
    const int M = new_polygon.size();
    vector<vector<bool>> visible_mask(N, vector<bool>(M, false));
    for(int j = 0; j < N; ++j) {
        const P p = polygon[j];
        for(int i = 0; i < M; ++i) {
            const int ni = (i+1) % M;
            if(can_see(p, new_polygon[i], polygon)
                && can_see(p, new_polygon[ni], polygon))
            {
                visible_mask[j][i] = true;
            }
        }
    }
    int ans = N;
    for(int pat = 0; pat < (1<<N); ++pat) {
        int popcnt = 0;
        vector<bool> mask(M, false);
        for(int i = 0; i < N; ++i) {
            if(pat & (1<<i)) {
                ++popcnt;
                for(int j = 0; j < M; ++j) {
                    mask[j] = mask[j] | visible_mask[i][j];
                }
            }
        }
        if(all_of(mask.begin(), mask.end(), [](bool b){return b;})) {
            ans = min(ans, popcnt);
        }
    }
    cout << ans << endl;
    return true;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);

    while(solve()) ;
    return 0;
}