#include <bits/stdc++.h>
using namespace std;
namespace std {
template <class S, class T>
struct hash<pair<S, T>> {
  size_t operator()(const pair<S, T> &p) const {
    return ((size_t)1e9 + 7) * hash<S>()(p.first) + hash<T>()(p.second);
  }
};
template <class T>
struct hash<vector<T>> {
  size_t operator()(const vector<T> &v) const {
    size_t h = 0;
    for (auto i : v) h = h * ((size_t)1e9 + 7) + hash<T>()(i) + 1;
    return h;
  }
};
}  // namespace std
template <class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "[ ";
  for (int i = 0; i < (int)v.size(); i++)
    os << v[i] << (i == v.size() - 1 ? " ]" : ", ");
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const set<T> &v) {
  os << "{ ";
  for (const auto &i : v) os << i << ", ";
  return os << "}";
}
template <class T, class U>
ostream &operator<<(ostream &os, const map<T, U> &v) {
  os << "{";
  for (const auto &i : v) os << " " << i.first << ": " << i.second << ",";
  return os << "}";
}
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
void dbgprint(const string &fmt) { cerr << endl; }
template <class H, class... T>
void dbgprint(const string &fmt, const H &h, const T &...r) {
  cerr << fmt.substr(0, fmt.find(",")) << "= " << h << " ";
  dbgprint(fmt.substr(fmt.find(",") + 1), r...);
}
const double EPS = 1e-8, INF = 1e12, PI = acos(-1.0);
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
inline double cross(const complex<double> &a, const complex<double> &b) {
  return imag(conj(a) * b);
}
inline double dot(const complex<double> &a, const complex<double> &b) {
  return real(conj(a) * b);
}
struct L : public vector<complex<double>> {
  L(const complex<double> &a, const complex<double> &b) {
    push_back(a);
    push_back(b);
  }
};
inline int ccw(complex<double> a, complex<double> b, complex<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 (norm(b) + EPS < norm(c)) return -2;
  return 0;
}
bool intersectLS(const L &l, const L &s) {
  return cross(l[1] - l[0], s[0] - l[0]) * cross(l[1] - l[0], s[1] - l[0]) <
         EPS;
}
bool intersectSS(const L &s, const L &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 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];
  if (abs(A) < EPS) assert(false);
  return m[0] + B / A * (m[1] - m[0]);
}
vector<complex<double>> convex_hull(vector<complex<double>> ps) {
  int n = ps.size(), k = 0;
  sort(ps.begin(), ps.end());
  vector<complex<double>> ch(2 * n);
  for (int i = 0; i < n; ch[k++] = ps[i++])
    while (k >= 2 && ccw(ch[k - 2], ch[k - 1], ps[i]) <= 0) --k;
  for (int i = n - 2, t = k + 1; i >= 0; ch[k++] = ps[i--])
    while (k >= t && ccw(ch[k - 2], ch[k - 1], ps[i]) <= 0) --k;
  ch.resize(k - 1);
  return ch;
}
double area2(const vector<complex<double>> &g) {
  double A = 0;
  for (int i = 0; i < g.size(); ++i) A += cross(g[i], g[(i + 1) % g.size()]);
  return A;
}
enum { OUT, ON, IN };
int contains(const vector<complex<double>> &g, const complex<double> &p) {
  bool in = false;
  for (int i = 0; i < g.size(); ++i) {
    complex<double> a = g[i] - p, b = g[(i + 1) % g.size()] - p;
    if (imag(a) > imag(b) + EPS) 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;
}
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  int n;
  while (cin >> n, n) {
    vector<complex<double>> ps;
    for (int i = 0; i < (int)n; i++) {
      int x, y;
      cin >> x >> y;
      ps.emplace_back(x, y);
    }
    vector<vector<complex<double>>> points;
    for (int i = 0; i < (int)n; i++) {
      vector<complex<double>> pts = {ps[i], ps[(i + 1) % n]};
      L e(ps[i], ps[(i + 1) % n]);
      for (int j = 0; j < (int)n; j++)
        for (int k = 0; k < (int)j; k++) {
          L l(ps[j], ps[k]);
          if (!intersectLS(l, e)) continue;
          pts.push_back(crosspoint(l, e));
        }
      sort((pts).begin(), (pts).end(),
           [&](complex<double> a, complex<double> b) {
             return abs(ps[i] - a) < abs(ps[i] - b);
           });
      for (int j = 0; j < (int)(int)pts.size() - 1; j++)
        if (abs(pts[j] - pts[j + 1]) < EPS) {
          pts.erase(pts.begin() + j);
          j--;
        }
      int sz = (int)pts.size() - 1;
      for (int j = 0; j < (int)sz; j++)
        pts.push_back((pts[j] + pts[j + 1]) / 2.0);
      sort((pts).begin(), (pts).end(),
           [&](complex<double> a, complex<double> b) {
             return abs(ps[i] - a) < abs(ps[i] - b);
           });
      swap(pts[1], pts.back());
      points.push_back(pts);
    }
    int ans = (n + 1) / 2;
    for (int mask = 0; mask < (int)1 << n; mask++) {
      int sz = __builtin_popcount(mask);
      if (sz >= ans) continue;
      for (const auto &pts : points)
        for (const complex<double> &p : pts) {
          bool ok = 0;
          for (int i = 0; i < (int)n; i++)
            if (mask & 1 << i) {
              L l(p, ps[i]);
              vector<complex<double>> crs = {l[0], l[1]};
              for (int j = 0; j < (int)n; j++) {
                L e(ps[j], ps[(j + 1) % n]);
                if (intersectSS(l, e)) goto NG;
              }
              for (int j = 0; j < (int)n; j++)
                if (ccw(l[0], ps[j], l[1]) == -2) crs.push_back(ps[j]);
              sort((crs).begin(), (crs).end(),
                   [&](complex<double> a, complex<double> b) {
                     return abs(l[0] - a) < abs(l[0] - b);
                   });
              for (int j = 0; j < (int)(int)crs.size() - 1; j++) {
                if (contains(ps, (crs[j] + crs[j + 1]) / 2.0) == OUT) {
                  goto NG;
                }
              }
              ok = 1;
              break;
            NG:;
            }
          if (!ok) goto NEXT;
        }
      ans = min(ans, sz);
    NEXT:;
    }
    cout << ans << endl;
  }
  return 0;
}
