#include <bits/stdc++.h>
using namespace std;
struct data {
  double d;
  complex<double> 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(complex<double> a, complex<double> b) { return (abs(a - b) < eps); }
bool onSegment(complex<double> a, complex<double> b, complex<double> p) {
  return eq(abs(a - b), abs(a - p) + abs(b - p));
}
double dot(complex<double> a, complex<double> b) { return real(b * conj(a)); }
double cross(complex<double> a, complex<double> b) { return imag(b * conj(a)); }
complex<double> getPoint(complex<double> a, complex<double> b,
                         complex<double> c, complex<double> d) {
  a -= d;
  b -= d;
  c -= d;
  return d + a + (b - a) * imag(a / c) / imag(a / c - b / c);
}
bool isParallel(complex<double> a, complex<double> b, complex<double> c,
                complex<double> d) {
  return eq(0, cross(a - b, c - d));
}
int n;
complex<double> t[16];
vector<complex<double> > A, B;
double Arg(complex<double> a, complex<double> b, complex<double> c) {
  b -= a, c -= a;
  return arg(c * conj(b));
}
bool inPolygon(complex<double> p) {
  double sum = 0;
  for (int i = 0; i < n; i++) {
    complex<double> 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(complex<double> a, complex<double> b) {
  vector<data> v;
  for (int i = 0; i < n; i++) {
    complex<double> c = t[i], d = t[(i + 1) % n];
    if (isParallel(a, b, c, d)) continue;
    complex<double> 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++) {
    complex<double> a = t[i], b = t[(i + 1) % n];
    vector<data> v;
    for (int j = 0; j < n; j++) {
      complex<double> c = t[j], d = t[(j + 1) % n];
      if (eq(0, cross(a - b, c - d))) continue;
      complex<double> 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++) {
    complex<double> a = A[i], b = A[(i + 1) % A.size()];
    B.push_back(a);
    complex<double> 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++) {
    complex<double> a = B[i];
    for (int j = 0; j < n; j++) {
      g[i][j] = inPolygon(a, t[j]);
    }
  }
  vector<int> G[9];
  for (int i = 0; i < (1 << n); i++) {
    int cnt = __builtin_popcount(i);
    if (cnt <= 8) G[cnt].push_back(i);
  }
  for (int i = 1; i <= 8; 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 9;
}
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] = complex<double>(x, y);
    }
    cout << solve() << endl;
  }
  return 0;
}
