#include<bits/stdc++.h>
using namespace std;
typedef complex<double> P;

struct data{
  double d;
  P p;
  bool operator < (const data &a)const{
    return d < a.d;
  }
};

double eps=1e-8;
double PI=acos(-1);

bool eq(double a,double b){return (b-a<eps&&a-b<eps);}
bool eq(P a,P b){return (abs(a-b)<eps);}
bool onSegment(P a,P b,P p){
  return eq( abs(a-b) , abs(a-p) + abs(b-p) );
}

double dot(P a,P b){return real(b*conj(a));}
double cross(P a,P b){return imag(b*conj(a));}
P getPoint(P a,P b,P c,P d){
  a-=d;b-=d;c-=d;
  return d+a+(b-a)*imag(a/c)/imag(a/c-b/c);
}
bool isParallel(P a,P b,P c,P d){
  return eq(0,cross(a-b,c-d));
}
int n;
P t[16];
vector<P> A,B;

double Arg(P a,P b,P c){
  b-=a,c-=a;
  return arg(c*conj(b));
}
 
bool inPolygon(P p){
  double sum=0;  
  for(int i=0;i<n;i++){
    P a=t[i],b=t[(i+1==n?0:i+1)];
    if(onSegment(a,b,p))return true;
    sum+= Arg(p,a,b);
  }
  if( abs(sum) < eps )return false;
  else  return true;
}

bool inPolygon(P a,P b){
  vector< data > v;
  for(int i=0;i<n;i++){
    P c=t[i],d=t[(i+1)%n];
    if(isParallel(a,b,c,d))continue;
    P sp=getPoint(a,b,c,d);
    if(!onSegment(a,b,sp))continue;
    if(!onSegment(c,d,sp))continue;
    v.push_back((data){ abs(a-sp) , sp});
  }
  v.push_back( (data){0,a} );
  v.push_back( (data){abs(a-b),b} );
  sort(v.begin(),v.end());

  for(int i=0;i<(int)v.size();i++){
    if( !inPolygon(v[i].p) )return false;
    if(i&& !inPolygon( (v[i].p+v[i-1].p)*0.5 ) )return false;
  }
  return true;
}


int solve(){
  A.clear();B.clear();
  for(int i=0;i<n;i++){
    P a=t[i],b=t[(i+1)%n];
    vector< data > v;
    for(int j=0;j<n;j++){
      P c=t[j];
      for(int k=0;k<j;k++){
        P d=t[k];
        if( eq( 0, cross(a-b,c-d) ) )continue;
        P np = getPoint(a,b,c,d);
        if(!onSegment(a,b,np))continue;
        v.push_back((data){ abs(np-a) , np } );
      }
    }
    sort(v.begin(),v.end());
    A.push_back(a);
    for(int j=0;j<(int)v.size();j++){
      A.push_back(v[j].p);
    }
  }

  for(int i=0;i<(int)A.size();i++){
    P a=A[i],b=A[(i+1)%A.size()];
    B.push_back(a);
    //P c=(a+b)*0.5;
    //        if( inPolygon(c) )B.push_back(c);
  }
  
  bool g[1000][16]={};
  for(int i=0;i<(int)B.size();i++){
    P a=B[i];
    for(int j=0;j<n;j++){
      g[i][j]=inPolygon(a,t[j]);
      //      cout<<a<<' '<<t[j]<<' '<<g[i][j]<<endl;        ////////////////
    }
  }
  
  vector<int> G[7];
  for(int i=0;i<(1<<n);i++){
    int cnt=__builtin_popcount(i);
    if(cnt<=6)G[cnt].push_back(i);
  }
  
  for(int i=1;i<=6;i++){
    for(int j=0;j<(int)G[i].size();j++){
      int bit=G[i][j];
      int cnt=0;
      for(int k=0;k<(int)B.size();k++){
        bool flg=false;
        for(int l=0;l<n;l++){
          if(bit>>l&1){
            flg|=g[k][l];
          }
        }
        if(flg)cnt++;
      }
      if(cnt==(int)B.size()){
         return i;
      }
    }
  }
  assert(0);
  return 7;
}

int main(){
  while(1){
    cin>>n;
    if(n==0)break;
    for(int i=0;i<n;i++){
      double x,y;
      cin>>x>>y;
      t[i]=P(x,y);
    }
    cout<<solve()<<endl;
  }
  return 0;
}