#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-10;
const long double PI = acos(-1);
namespace std {
bool operator<(const complex<long double> &a, const complex<long double> &b) {
  return (abs((real(a)) - (real(b))) < EPS) ? imag(a) < imag(b)
                                            : real(a) < real(b);
}
bool operator==(const complex<long double> &a, const complex<long double> &b) {
  return (abs((a) - (b)) < EPS);
}
}  // namespace std
inline complex<long double> unit(complex<long double> p) { return p / abs(p); }
inline pair<complex<long double>, complex<long double> > norm(
    complex<long double> p) {
  return make_pair(p * complex<long double>(0, 1),
                   p * complex<long double>(0, -1));
}
inline long double dot(complex<long double> x, complex<long double> y) {
  return real(conj(x) * y);
}
inline long double cross(complex<long double> x, complex<long double> y) {
  return imag(conj(x) * y);
}
inline complex<long double> rotate(complex<long double> v, long double s) {
  return complex<long double>(real(v) * cos(s) - imag(v) * sin(s),
                              real(v) * sin(s) + imag(v) * cos(s));
}
inline long double arg(complex<long double> a, complex<long double> b,
                       complex<long double> c) {
  return acos(dot(b - a, c - a) / (abs(b - a) * abs(c - a)));
}
inline long double arg(long double a, long double b, long double c) {
  return acos((b * b + c * c - a * a) / (2 * b * c));
}
inline long double heron(long double a, long double b, long double c) {
  long double s = (a + b + c) / 2;
  return sqrt(s * (s - a) * (s - b) * (s - c));
}
int ccw(complex<long double> a, complex<long double> b,
        complex<long double> c) {
  b -= a;
  c -= a;
  if (cross(b, c) > EPS) return 1;
  if (cross(b, c) < -EPS) return -1;
  if (dot(b, c) < -EPS) return 2;
  if (abs(b) < abs(c)) return -2;
  return 0;
}
inline bool orth(pair<complex<long double>, complex<long double> > a,
                 pair<complex<long double>, complex<long double> > b) {
  return abs(dot(a.first - a.second, b.first - b.second)) < EPS;
}
inline bool para(pair<complex<long double>, complex<long double> > a,
                 pair<complex<long double>, complex<long double> > b) {
  return abs(cross(a.first - a.second, b.first - b.second)) < EPS;
}
inline long double line_dis(pair<complex<long double>, complex<long double> > a,
                            complex<long double> x) {
  return abs(cross(a.second - a.first, x - a.first)) / abs(a.second - a.first);
}
inline complex<long double> line_cp(
    pair<complex<long double>, complex<long double> > a,
    pair<complex<long double>, complex<long double> > b) {
  return a.first + (a.second - a.first) *
                       cross(b.second - b.first, b.first - a.first) /
                       cross(b.second - b.first, a.second - a.first);
}
inline long double seg_p_dis(
    pair<complex<long double>, complex<long double> > a,
    complex<long double> x) {
  if (dot(a.second - a.first, x - a.first) < EPS) return abs(x - a.first);
  if (dot(a.first - a.second, x - a.second) < EPS) return abs(x - a.second);
  return abs(cross(a.second - a.first, x - a.first)) / abs(a.second - a.first);
}
inline long double seg_seg_dis(
    pair<complex<long double>, complex<long double> > a,
    pair<complex<long double>, complex<long double> > b) {
  long double res = 1e10;
  res = min(res, seg_p_dis(a, b.first));
  res = min(res, seg_p_dis(a, b.second));
  res = min(res, seg_p_dis(b, a.first));
  res = min(res, seg_p_dis(b, a.second));
  return res;
}
inline bool is_cp(pair<complex<long double>, complex<long double> > a,
                  pair<complex<long double>, complex<long double> > b) {
  if (ccw(a.first, a.second, b.first) * ccw(a.first, a.second, b.second) <= 0)
    if (ccw(b.first, b.second, a.first) * ccw(b.first, b.second, a.second) <= 0)
      return true;
  return false;
}
inline bool in_poly(vector<complex<long double> > p, complex<long double> x) {
  if (p.empty()) return false;
  int s = p.size();
  long double xMax = x.real();
  for (int i = 0; i < (int)(s); i++) {
    if (xMax < p[i].real()) xMax = p[i].real();
    if ((abs((x) - (p[i])) < EPS)) return false;
  }
  pair<complex<long double>, complex<long double> > h =
      pair<complex<long double>, complex<long double> >(
          x, complex<long double>(xMax + 1.0, x.imag()));
  int c = 0;
  for (int i = 0; i < (int)(s); i++) {
    pair<complex<long double>, complex<long double> > l =
        pair<complex<long double>, complex<long double> >(p[i], p[(i + 1) % s]);
    if (!para(h, l) && is_cp(h, l)) {
      complex<long double> cp = line_cp(h, l);
      if (cp.real() < x.real() + EPS) continue;
      if (!(abs((cp) - ((l.first.imag() < l.second.imag()) ? l.second
                                                           : l.first)) < EPS))
        c++;
    }
  }
  return (c & 1) ? true : false;
}
int main() {
  int n;
  complex<long double> p[20];
  pair<complex<long double>, complex<long double> > l[20];
  while (cin >> n, n) {
    vector<complex<long double> > poly;
    for (int i = 0; i < (int)(n); i++) {
      int x, y;
      cin >> x >> y;
      p[i] = complex<long double>(x, y);
      poly.push_back(p[i]);
    }
    for (int i = 0; i < (int)(n); i++)
      l[i] = pair<complex<long double>, complex<long double> >(p[i],
                                                               p[(i + 1) % n]);
    vector<pair<complex<long double>, complex<long double> > > segs;
    for (int i = 0; i < (int)(n); i++) {
      vector<complex<long double> > cut_point;
      for (int j = 0; j < (int)(n); j++) {
        for (int k = 0; k < (int)(n); k++) {
          pair<complex<long double>, complex<long double> > l2 =
              pair<complex<long double>, complex<long double> >(p[j], p[k]);
          if (!para(l[i], l2)) {
            complex<long double> cp = line_cp(l[i], l2);
            if (!ccw(l[i].first, l[i].second, cp)) {
              cut_point.push_back(cp);
            }
          }
        }
      }
      cut_point.push_back(l[i].first);
      cut_point.push_back(l[i].second);
      sort((cut_point).begin(), (cut_point).end());
      for (int i = 1; i < (int)cut_point.size(); i++) {
        if ((abs((cut_point[i - 1]) - (cut_point[i])) < EPS)) continue;
        segs.push_back(pair<complex<long double>, complex<long double> >(
            cut_point[i - 1], cut_point[i]));
      }
    }
    vector<vector<int> > visible(n);
    for (int i = 0; i < (int)(n); i++)
      for (int j = 0; j < (int)(segs.size()); j++) {
        pair<complex<long double>, complex<long double> >
            lay1 = pair<complex<long double>, complex<long double> >(
                p[i], segs[j].first),
            lay2 = pair<complex<long double>, complex<long double> >(
                p[i], segs[j].second);
        bool f = false;
        for (int k = 0; k < (int)(segs.size()); k++) {
          if (!para(lay1, segs[k])) {
            complex<long double> cp1 = line_cp(lay1, segs[k]);
            if (!(abs((lay1.first) - (cp1)) < EPS) &&
                !(abs((lay1.second) - (cp1)) < EPS) &&
                !ccw(lay1.first, lay1.second, cp1) &&
                !ccw(segs[k].first, segs[k].second, cp1)) {
              f = true;
            }
          }
          if (!para(lay2, segs[k])) {
            complex<long double> cp2 = line_cp(lay2, segs[k]);
            if (!(abs((lay2.first) - (cp2)) < EPS) &&
                !(abs((lay2.second) - (cp2)) < EPS) &&
                !ccw(lay2.first, lay2.second, cp2) &&
                !ccw(segs[k].first, segs[k].second, cp2)) {
              f = true;
            }
          }
        }
        if (f) continue;
        f = false;
        complex<long double> mp = 1.0L / 3 * (p[i] + lay1.second + lay2.second);
        for (int k = 0; k < (int)(n); k++) {
          if (!ccw(l[k].first, l[k].second, mp)) f = true;
        }
        if (f || in_poly(poly, mp)) visible[i].push_back(j);
      }
    int ans = n;
    for (int i = 0; i < (int)(1 << n); i++) {
      vector<bool> ok(segs.size(), false);
      for (int j = 0; j < (int)(n); j++) {
        if ((i >> j) & 1) {
          for (int k = 0; k < (int)(visible[j].size()); k++)
            ok[visible[j][k]] = true;
        }
      }
      bool f = true;
      for (int j = 0; j < (int)(ok.size()); j++) f &= ok[j];
      if (f) ans = min(ans, __builtin_popcount(i));
    }
    cout << ans << endl;
  }
}
