#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-10;
bool eq(double a, double b) { return abs(a - b) < EPS; }
namespace std {
bool operator<(const complex<double>& a, const complex<double>& b) {
  return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
}
}  // namespace std
double cross(const complex<double>& a, const complex<double>& b) {
  return imag(conj(a) * b);
}
double dot(const complex<double>& a, const complex<double>& b) {
  return real(conj(a) * b);
}
int ccw(complex<double> a, complex<double> b, complex<double> c) {
  b -= a;
  c -= a;
  if (cross(b, c) > 0) return +1;
  if (cross(b, c) < 0) return -1;
  if (dot(b, c) < 0) return +2;
  if (norm(b) < norm(c)) return -2;
  return 0;
}
bool intersectLS(const array<complex<double>, 2>& l,
                 const array<complex<double>, 2>& s) {
  return cross(l[1] - l[0], s[0] - l[0]) * cross(l[1] - l[0], s[1] - l[0]) <
         EPS;
}
bool intersectSS(const array<complex<double>, 2>& s,
                 const array<complex<double>, 2>& 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;
}
complex<double> crosspoint(const array<complex<double>, 2>& l,
                           const array<complex<double>, 2>& 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];
  if (abs(A) < EPS) assert(false);
  return m[0] + B / A * (m[1] - m[0]);
}
bool contains(const array<complex<double>, 2>& l, const complex<double>& p) {
  complex<double> a = l[0] - p, b = l[1] - p;
  return eq(cross(a, b), 0) && dot(a, b) <= EPS;
}
enum { OUT = 0, ON, IN };
int contains(const vector<complex<double>>& P, const complex<double>& p) {
  bool in = false;
  for (int i = 0; i < P.size(); ++i) {
    complex<double> a = P[i] - p, b = P[(i + 1) % P.size()] - p;
    if (imag(a) > imag(b)) swap(a, b);
    if (imag(a) <= 0 && 0 < imag(b) && cross(a, b) < 0) in = !in;
    if (cross(a, b) == 0 && dot(a, b) <= 0) return ON;
  }
  return in ? IN : OUT;
}
int n;
vector<complex<double>> pol;
vector<vector<complex<double>>> on;
bool no_wall(const complex<double>& c, const complex<double>& p) {
  array<complex<double>, 2> seg = {{c, p}};
  vector<complex<double>> points;
  for (int i = 0; i < n; i++) {
    array<complex<double>, 2> t = {{pol[i], pol[(i + 1) % n]}};
    if (intersectSS(seg, t)) {
      points.push_back(crosspoint(seg, t));
    }
  }
  sort(points.begin(), points.end());
  for (int i = 0; i < points.size() - 1; i++) {
    if (!contains(pol, (points[i] + points[i + 1]) * 0.5)) return false;
  }
  return true;
}
bool is_gettable(int ptn, const complex<double>& c) {
  for (int i = 0; i < n; i++) {
    if (ptn >> i & 1 && no_wall(c, pol[i])) {
      return true;
    }
  }
  return false;
}
bool valid_ptn(int ptn) {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < static_cast<int>(on.size() - 1); j++) {
      complex<double> c = (on[i][j] + on[i][j + 1]) * 0.5;
      if (!is_gettable(ptn, c)) {
        return false;
      }
    }
  }
  return true;
}
int main() {
  while (cin >> n, n) {
    pol.resize(n);
    for (auto& p : pol) {
      int x, y;
      cin >> x >> y;
      p = complex<double>(x, y);
    }
    vector<complex<double>> points = pol;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < i; j++) {
        array<complex<double>, 2> l = {{pol[i], pol[j]}};
        for (int k = 0; k < n; k++) {
          array<complex<double>, 2> s = {{pol[k], pol[(k + 1) % n]}};
          if (intersectLS(l, s)) {
            points.push_back(crosspoint(l, s));
          }
        }
      }
    }
    sort(points.begin(), points.end());
    points.erase(unique(points.begin(), points.end()), points.end());
    on.resize(n);
    for (int i = 0; i < n; i++) {
      array<complex<double>, 2> s = {{pol[i], pol[(i + 1) % n]}};
      for (const auto& p : points) {
        if (contains(s, p)) {
          on[i].push_back(p);
        }
      }
      sort(on[i].begin(), on[i].end());
    }
    int ans = n;
    for (int ptn = 0; ptn < 1 << n; ptn++) {
      int cnt = __builtin_popcount(ptn);
      if (cnt >= ans) continue;
      if (valid_ptn(ptn)) ans = cnt;
    }
    cout << ans << endl;
  }
  return 0;
}
