#include<iostream>
#include<complex>
#include<algorithm>
#include<vector>

using namespace std;

#define rep(i, n) for (int i = 0; i < int(n); ++i)

#define X real()
#define Y imag()

typedef long double D;
typedef complex<D> P;
struct L{P a, b;};
typedef vector<P> Pol;

const D EPS = 1e-8;

int sig(D a, D b = 0) {return a < b - EPS ? -1 : a > b + EPS ? 1 : 0;}
bool near(P a, P b) {return !sig(norm(a - b));}
namespace  std{
  bool operator<(P a, P b) {return sig(a.X, b.X) ? a.X < b.X : a.Y < b.Y;}
}

D dot(P a, P b) {return a.X * b.X + a.Y * b.Y;}
D det(P a, P b) {return a.X * b.Y - a.Y * b.X;}

P vec(L a) {return a.b - a.a;}

enum CCW{FRONT = 1, RIGHT = 2, BACK = 4, LEFT = 8, ON = 16};
int ccw(P a, P b, P c) {
  if (near(a, c) || near(b, c)) return ON;
  int s = sig(det(b - a, c - a));
  if (s) return s > 0 ? LEFT : RIGHT;
  return (a < b) == (b < c) ? FRONT : (c < a) == (a < b) ? BACK : ON;
}

bool iLLs(L a, L b) {return sig(det(vec(a), vec(b)));}

P pLL(L a, L b) {return a.a + vec(a) * (det(vec(b), b.a - a.a) / det(vec(b), vec(a)));}

int sAP(P a, P b, P c) {return sig(det(a, c)) - sig(det(b, c)) - sig(det(a, b));}

bool iGS(Pol pol, L s) {
  int n = pol.size();
  vector<int> sa(n + 1), sb(n + 1), sab(n + 1);
  pol.push_back(pol[0]);
  pol.push_back(pol[1]);
  rep (i, n + 1) {
    sa[i] = sig(det(pol[i + 1] - pol[i], s.a - pol[i]));
    sb[i] = sig(det(pol[i + 1] - pol[i], s.b - pol[i]));
    sab[i] = sig(det(s.b - s.a, pol[i] - s.a));
  }
  rep (i, n) if (sa[i] * sb[i] < 0 && sab[i] * sab[i + 1] < 0) return true;
  rep (i, n) {
    if (sa[i] == 0 && sb[i] > 0 && sig(dot(s.a - pol[i], s.a - pol[i + 1])) < 0) return true;
    if (sb[i] == 0 && sa[i] > 0 && sig(dot(s.b - pol[i], s.b - pol[i + 1])) < 0) return true;
  }
  rep (i, n) if (sab[i + 1] == 0 && sig(dot(pol[i + 1] - s.a, pol[i + 1] - s.b)) <= 0) {
    if (!near(pol[i + 1], s.a) && sAP(pol[i + 2] - pol[i + 1], pol[i] - pol[i + 1], s.a - pol[i + 1]) > 0) return true;
    if (!near(pol[i + 1], s.b) && sAP(pol[i + 2] - pol[i + 1], pol[i] - pol[i + 1], s.b - pol[i + 1]) > 0) return true;
  }
  return false;
}

int main() {
  while (true) {
    int n;
    cin >> n;
    if (n == 0) break;
    Pol pol(n);
    rep (i, n) cin >> pol[i].X >> pol[i].Y;
    vector<P> vp;
    rep (i, n) {
      vector<P> vvp;
      vvp.push_back(pol[i]);
      vvp.push_back(pol[(i + 1) % n]);
      L l1 = (L){pol[i], pol[(i + 1) % n]};
      rep (j, n) rep (k, j) {
	L l2 = (L){pol[j], pol[k]};
	if (!iLLs(l1, l2)) continue;
	P p = pLL(l1, l2);
	if (ccw(l1.a, l1.b, p) != ON) continue;
	vvp.push_back(p);
      }
      sort(vvp.begin(), vvp.end());
      vvp.erase(unique(vvp.begin(), vvp.end(), near), vvp.end());
      rep (j, vvp.size() - 1) vp.push_back((vvp[j] + vvp[j + 1]) / (D)2);
    }
    vector<int> flags;
    Pol rpol = pol;
    reverse(rpol.begin(), rpol.end());
    rep (i, vp.size()) {
      int bit = 0;
      rep (j, n) {
	L s = (L){vp[i], pol[j]};
	if (iGS(rpol, s)) continue;
	bit |= 1 << j;
      }
      flags.push_back(bit);
    }
    int res = n;
    rep (i, 1 << n) if (res > __builtin_popcount(i)) {
      rep (j, vp.size()) {
	bool ok = false;
	rep (k, n) if ((i & 1 << k) && (flags[j] & 1 << k)) {
	  ok = true;
	}
	if (!ok) goto next;
      }
      res = __builtin_popcount(i);
    next:;
    }
    cout << res << endl;
  }
  return 0;
}

Measured memory_bytes: 1324