#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 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 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;
}
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]);
}
double angle(const P &a, const P &b) {        // テ」ツδ凖」ツつッテ」ツδ暗」ツδォテッツスツ?」ツ?凝」ツつ嘉」ツ?ソテ」ツ?淌」ツδ凖」ツつッテ」ツδ暗」ツδォテッツスツづ」ツ?ョティツァツ津・ツコツヲテ」ツ?ョティツィツ暗ァツョツ夕0,2pi)
  double ret = arg(b)-arg(a);
  return (ret>-EPS) ? ret : ret + 2*PI;
}



P p[20];
int n;

enum { OUT, ON, IN };
int contains(const P&q) {
  bool in = false; 
  for (int i = 0; i < n; ++i) {
    P a = p[i] - q, b = p[(i+1)%n] - q;
    if (imag(a) > imag(b)) swap(a, b);
    if (imag(a) <= EPS && EPS < imag(b))
      if (cross(a, b) < EPS) in = !in;
    if (abs(cross(a, b)) <EPS && dot(a, b) <= EPS) return ON;
  }
  return in ? IN : OUT;
}


typedef bitset<300> 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;
    if (angle(p[(a+1)%n]-p[a],p[(a+n-1)%n]-p[a]) + EPS < angle(p[(a+1)%n]-p[a],q-p[a])) {
      // cout << p[a] << " : " << q << endl;
      ok = 0;
    }
    if (contains((p[a]+q)*P(0.5,0)) == OUT) ok = 0;
    REP(j,n) {
      if (intersectSS2(L(p[a],q), L(p[j],p[(j+1)%n]))) {
        // cout << p[a] << " " << q << "     " << p[j] << " " << p[(j+1)%n] << 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,i) {
        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);
      }
    }
    // REP(i,n) {
    //   cout << i << endl;
    //   FOR(it, pv[i]) cout << *it << " "; cout << endl;
    //   REP(j,n) cout << a[j][i] << endl;
    // }
    int ans = n;
    bool hoge = 0;
    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) {
        hoge = 1;
        chmin(ans, __builtin_popcount(S));
      }
    }
    assert(hoge);
    cout << ans << endl;
  }
}

Measured memory_bytes: 1380