#include <iostream>
#include <iomanip>
#include <complex>
#include <vector>
#include <utility>
#include <algorithm>
#include <cmath>
#include <bitset>
using namespace std;

#define MAX_PART 512

const double EPS = 1e-10;
const double INF = 1e12;
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)
#define X real()
#define Y imag()

typedef complex<double> P;
typedef vector<P> VP;
struct L : VP{
    L(const P& a, const P& b){ resize(2); at(0)=a; at(1)=b; }
    L(){ resize(2); }
};
namespace std{
    bool operator < (const P& a, const P& b){
        return (a.X!=b.X) ? a.X<b.X : a.Y<b.Y;
    }
    bool operator == (const P& a, const P& b){
        return abs(a-b) < EPS;
    }
}

double dot(P a, P b){
    return (conj(a)*b).X;
}
double cross(P a, P b){
    return (conj(a)*b).Y;
}
int ccw(P a, P b, P c){
    b -= a;
    c -= a;
    if(cross(b,c) > EPS) return +1; //ccw
    if(cross(b,c) <-EPS) return -1; //cw
    if(dot(b,c) < EPS) return +2; //c-a-b
    if(norm(b) < norm(c)) return -2; //a-b-c
    return 0; //a-c-b
}
bool sameLL(const L &l, const L &m) {
    return ( abs(cross(l[1]-l[0], m[0]-l[0])) < EPS ) &&
        ( abs(cross(l[1]-l[0], m[0]-l[0])) < EPS );
}
bool intersectSP(const L& s, const P& p){
    return abs(s[0]-p) +abs(s[1]-p) -abs(s[1]-s[0]) < EPS;
}
bool intersectSS(const L& s, const L& t){
    for(int i=0; i<2; i++){
        for(int j=0; j<2; j++){
            if(s[i]==t[j]) return true;
        }
    }
    return ( ccw(s[0],s[1],t[0]) *ccw(s[0],s[1],t[1]) <= 0 ) &&
        ( ccw(t[0],t[1],s[0]) *ccw(t[0],t[1],s[1]) <= 0 );
}
bool intersectLS(const L& l, const L& s){
    return cross(l[1]-l[0], s[0]-l[0])*
        cross(l[1]-l[0], s[1]-l[0]) < EPS;
}
P crosspointLL(const L &l, const L &m) {
    double A = cross(l[1]-l[0], m[1]-m[0]);
    double B = cross(l[1]-l[0], l[1]-m[0]);
    return m[0] + B /A *(m[1]-m[0]);
}

bool isParallel(const P &a, const P &b){
    return abs(cross(a,b)) < EPS;
}
bool isParallel(const L &a, const L &b){
    return isParallel(a[1]-a[0], b[1]-b[0]);
}

//???????¨?
bool in_poly(const P &p, const VP &poly){
    int n = poly.size();
    int cn=0;
    //??????????????????true
    for(int i=0; i<n; i++){
        if(intersectSP(L(poly[i], poly[(i+1)%n]), p)){
            return true;
        }
    }
    L ray(p, p+P(INF, 0));
    for(int i=0; i<n; i++){
        if((poly[i].Y <= p.Y && poly[(i+1)%n].Y > p.Y) ||
           (poly[i].Y > p.Y && poly[(i+1)%n].Y <= p.Y)){
            if(intersectSS(ray, L(poly[i],poly[(i+1)%n]))){
                cn++;
            }
        }
    }
    return cn%2 != 0;
}

//???????¨?
//l????????????????§???¢???????????????????????¨??§???????????¨???????????????
bool isVisible(const L &l, const VP &poly){
    int n = poly.size();
    VP cp;
    for(int i=0; i<n; i++){
        L edge(poly[i], poly[(i+1)%n]);
        if(!isParallel(l, edge) && intersectSS(l, edge)){
            cp.push_back(crosspointLL(l, edge));
        }
    }
    sort(cp.begin(), cp.end());
    
    bool ret = true;
    for(int i=0; i<(int)cp.size()-1; i++){
        //???????????????????????????????????????????????§????§???¢?????¨???????????????ok
        if(!in_poly((cp[i]+cp[i+1])/2.0, poly)){
            ret = false;
            break;
        }
    }
    return ret;
}

int bitcount(int n){
    n = (n & 0x55555555) + (n >> 1 & 0x55555555);
    n = (n & 0x33333333) + (n >> 2 & 0x33333333);
    n = (n & 0x0f0f0f0f) + (n >> 4 & 0x0f0f0f0f);
    n = (n & 0x00ff00ff) + (n >> 8 & 0x00ff00ff);
    return (n & 0x0000ffff) + (n >>16 & 0x0000ffff);
}


int main(){
    while(1){
        int n;
        cin >> n;
        if(n==0) break;
    
        VP poly(n);
        for(int i=0; i<n; i++){
            int x,y;
            cin >> x >> y;
            poly[i] = P(x,y);
        }


        //???????????????????????°???????????????
        vector<vector<bool> > vvis(n, vector<bool>(n, false));
        for(int i=0; i<n; i++){
            vvis[i][i] = true;
            for(int j=i+1; j<n; j++){
                L ray(poly[i], poly[j]);
                if(isVisible(ray, poly)){
                    vvis[i][j] = vvis[j][i] = true;
                }
            }
        }

        //cout << intersectSS(L(poly[0], poly[6]), L(poly[0], poly[1])) << endl;
        
        //????????§???????????????
        /*
        for(int i=0; i<n; i++){
            for(int j=0; j<n; j++){
                cerr << vvis[i][j] << " ";
            }
            cerr << endl;
        }
        cerr << endl;
        continue;
        */

        

        //vis[i][j]????§????
        //vis[i][j]=L(p1, p2);
        //i????????????????????????j???????????????p1??????p2???????????????????????????
        vector<vector<L> > vis(n, vector<L>(n));
        //?????????
        for(int i=0; i<n; i++){
            for(int j=0; j<n; j++){
                vis[i][j][0] = max(poly[j],poly[(j+1)%n]);
                vis[i][j][1] = min(poly[j],poly[(j+1)%n]);
            }
        }
    
        //i?????????????????????j???????????????
        for(int i=0; i<n; i++){
            for(int j=0; j<n; j++){
                L edge(poly[j], poly[(j+1)%n]);
                //??????????????????????????????????°????????????????
                if(vvis[i][j] && vvis[i][(j+1)%n]){
                    vis[i][j][0] = min(edge[0], edge[1]);
                    vis[i][j][1] = max(edge[0], edge[1]);
                    continue;
                }
            
                //?????´???i-k????????????
                for(int k=0; k<n; k++){
                    if(i==k || !vvis[i][k]) continue;
                    L ray(poly[i], poly[k]);
                    //????¨??¨????
                    if(isParallel(ray, edge) || !intersectLS(ray, edge)) continue;
                
                    P target = crosspointLL(ray, edge);
                    //?????´?????????(i->k?????¶???????????§????????£??????)
                    if(abs(poly[i]-target) < abs(poly[k]-target)) continue;

                    if(isVisible(L(poly[k], target), poly)){
                        vis[i][j][0] = min(vis[i][j][0], target);
                        vis[i][j][1] = max(vis[i][j][1], target);
                    }
                }
            }
        }
        //????????§???????????????
        /*
        for(int i=0; i<n; i++){
            for(int j=0; j<n; j++){
                cerr << vis[i][j][0] << " " << vis[i][j][1] << endl;
            }
            cerr << endl;
        }
        cerr << endl;
        continue;
        */
    
        //???????????¨?????????????????????
        //???????????????????????°??????????????????????????§?????????????????¨?????????bitset???
        vector<vector<P> > cut(n);
        for(int i=0; i<n; i++){ //???i????????????
            //L edge(poly[i], poly[(i+1)%n]);
            for(int j=0; j<n; j++){
                cut[i].push_back(vis[j][i][0]);
                cut[i].push_back(vis[j][i][1]);
            }
            sort(cut[i].begin(), cut[i].end());
            cut[i].erase(unique(cut[i].begin(), cut[i].end()), cut[i].end());
        }

        //?????????
        /*
        for(int i=0; i<n; i++){
            cout << cut[i].size() << endl;
            for(int j=0; j<(int)cut[i].size(); j++){
                cout << cut[i][j] << endl;
            }
        }
        continue;
        */

        
        vector<bitset<MAX_PART> > cover(n);
        int offset=0;
        for(int i=0; i<n; i++){ //???i????????????
            for(int j=0; j<n; j++){ //??????j????????????
                if(vis[j][i][0] < vis[j][i][1]){                    
                    int s=0,e=0;
                    for(int k=0; k<(int)cut[i].size(); k++){
                        if(vis[j][i][0] == cut[i][k]){
                            s = k;
                        }
                        if(vis[j][i][1] == cut[i][k]){
                            e = k;
                            break;

                        }
                    }
                    for(int k=s; k<e; k++){
                        cover[j][offset+k] = 1;
                    }
                }
            }
            offset += cut[i].size() -1;
        }

        //?????????
        /*
        for(int i=0; i<n; i++){
            int offset = 0;
            for(int k=0; k<n; k++){
                for(int j=0; j<(int)cut[k].size()-1; j++){
                    cout << cover[i][offset+j] << " ";
                }
                offset += cut[k].size()-1;
                cout << " | ";
            }
            cout << endl;
        }
        continue;
        */
        
        bitset<MAX_PART> allbits;
        for(int i=0; i<offset; i++) allbits[i]=1;

        //???????????§?????????????????¨??¢?´¢
        int ans = (n+1)/2; //????????????????¨????????????°??????????????¶????????????
        for(int i=0; i<(1<<n); i++){
            //?????????????????£??????????????°???ans??\???????????°????????????
            if(bitcount(i) > ans) continue;
            bitset<MAX_PART> tmp;
            //?????????????????£???????????¨????????§???????????????
            for(int j=0; j<n; j++){
                if((i&(1<<j)) != 0){
                    tmp |= cover[j];
                }
            }
            //????????¨?????????????????§????????????????????°ans?????´??°
            if(tmp == allbits){
                ans = bitcount(i);
            }
        }
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 3184