#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define chmax(a,b) (a<b?(a=b,1):0)
#define chmin(a,b) (a>b?(a=b,1):0)
#define valid(y,x,h,w) (0<=y&&y<h&&0<=x&&x<w)
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

typedef complex<double> P;
namespace std {
  bool operator < (const P& a, const P& b) {
    // if (abs(a-b)<EPS) return 0;
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }
}
double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
  return real(conj(a)*b);
}
struct L : public vector<P> {
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
  L() {}
};

int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > EPS)   return +1;       // counter clockwise
  if (cross(b, c) < -EPS)   return -1;       // clockwise
  if (dot(b, c) < -EPS)     return +2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;       // a--b--c on line
  return 0;
}

bool intersectLL(const L &l, const L &m) {
  return abs(cross(l[1]-l[0], m[1]-m[0])) > EPS || // non-parallel
         abs(cross(l[1]-l[0], m[0]-l[0])) < EPS;   // same line
}
bool intersectLS(const L &l, const L &s) {
  return cross(l[1]-l[0], s[0]-l[0])*       // s[0] is left of l
         cross(l[1]-l[0], s[1]-l[0]) < EPS; // s[1] is right of l
}
bool intersectLP(const L &l, const P &p) {
  return abs(cross(l[1]-p, l[0]-p)) < EPS;
}
bool intersectSS(const L &s, const L &t) {
  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 intersectSS2(const L &s, const L &t) { // テヲツ篠・テ」ツ?療」ツ?ヲテ」ツ??」ツつ凝」ツつ?」ツ?、テ」ツ?ッテ、ツコツ、テ・ツキツョテ」ツ?ィティツ?ε」ツ?暗」ツ?ェテ」ツ??
  return ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1]) == -1 &&
         ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1]) == -1;
  
  if (abs(cross(s[1]-s[0],t[1]-t[0])) < EPS) return 0;
  REP(i, 2) {
    if (ccw(s[0], s[1], t[i]) == 0) {
      int c = ccw(s[0],s[1],t[!i]);
      if (s[0] == t[i]) {
        if (c!=-2&&c) return 0;
      } else if (s[1] == t[i]) {
        if (c!=2&&c) return 0;
      } else if (abs(c)==1) return 0;
    }
  }
  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;
}

P crosspoint(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]);
  if (abs(A) < EPS && abs(B) < EPS) return m[0]; // same line
  if (abs(A) < EPS) assert(false); // !!!PRECONDITION NOT SATISFIED!!!
  return m[0] + B / A * (m[1] - m[0]);
}

P p[20];
int n;
typedef bitset<20> Bit;
vector<P> pv[20];

Bit calc(int a, int b) {
  int m = pv[b].size();
  Bit res;
  REP(i,m-1) {
    P q = (pv[b][i] + pv[b][i+1]) * P(0.5,0);
    bool ok = 1;
    REP(j,n) {
      // cout << p[a] << " " << q << "     " << p[j] << " " << p[(j+1)%n] << endl;
      if (intersectSS2(L(p[a],q), L(p[j],p[(j+1)%n]))) {
//        cout << "A" << endl;
        ok = 0;
      }
    }    
    if (ok) res[i] = 1;
  }
  return res;
}

Bit a[20][20];

int main() {
  while(cin>>n,n) {
    REP(i,n) cin >> p[i].real() >> p[i].imag();
    REP(i,n) pv[i].clear();
    // テ・ツ按?・ツ可イ
    REP(i,n) {
      REP(j,n) {
        if (i == j) continue;
        REP(k,n) {
          L s(p[k],p[(k+1)%n]);
          L l(p[i],p[j]);
          if (intersectLS(l,s)) {
            P cp = crosspoint(l,s);
            pv[k].push_back(cp);
          }
        }
      }
    }
    REP(i,n) {
      sort(ALL(pv[i]));
      pv[i].erase(unique(ALL(pv[i])), pv[i].end());
    }
    
    REP(i,n) {
      REP(j,n) {
        a[i][j] = calc(i,j);
      }
    }

    int ans = n;
    REP(S,1<<n) {
      Bit tmp[n];
      REP(i,n) {
        if (S>>i&1) {
          REP(j,n) {
            tmp[j] |= a[i][j];
          }
        }
      }
      bool f = 1;
      REP(i,n) if (tmp[i].count() != pv[i].size()-1) f = 0;
      if (f) {
        // cout << bitset<10>(S) << endl;
        chmin(ans, __builtin_popcount(S));
      }
    }
    cout << ans << endl;
  }
}