#include <bits/stdc++.h>
using namespace std;
typedef const complex<double> &rP;
inline double dot(rP a, rP b) { return real(a) * real(b) + imag(a) * imag(b); }
inline double cross(rP a, rP b) {
  return real(a) * imag(b) - imag(a) * real(b);
}
inline bool contain_s_p(rP a1, rP a2, rP b) {
  return abs(abs(a1 - b) + abs(a2 - b) - abs(a1 - a2)) < 1e-7;
}
inline bool contain_hl_p(rP a1, rP a2, rP b) {
  return contain_s_p(a1, a2, b) || contain_s_p(a1, b, a2);
}
inline vector<double> intersect_hl_s(rP pa1, rP pa2, rP pb1, rP pb2) {
  complex<double> da12 = pa2 - pa1;
  complex<double> db21 = pb1 - pb2;
  complex<double> dab1 = pb1 - pa1;
  double D = cross(da12, db21);
  vector<double> ret;
  if (abs(D) > 1e-7) {
    double t = cross(dab1, db21) / D;
    double s = cross(da12, dab1) / D;
    if (-1e-7 < t && (-1e-7 < s && s < 1.0 + 1e-7)) {
      ret.push_back(t);
      ret.push_back(s);
    }
  } else if (contain_hl_p(pa1, pa2, pb1)) {
    ret.push_back(abs(dab1) / abs(da12));
    ret.push_back(0.0);
    ret.push_back(abs(pb2 - pa1) / abs(da12));
    ret.push_back(1.0);
  }
  return ret;
}
struct intrinfo {
  double t;
  int idx;
  double s;
  bool operator<(const intrinfo &i) const { return t < i.t; }
};
int n;
vector<complex<double> > plg;
double pi;
double checkarg(rP base, rP pa, rP pb, rP pc) {
  double a = arg(pa - base);
  double b = arg(pb - base);
  double c = arg(pc - base);
  if (b + 1e-7 < a) b += 2.0 * pi;
  if (c + 1e-7 < a) c += 2.0 * pi;
  return a < b + 1e-7 && b < c + 1e-7;
}
bool checkrange(vector<pair<double, int> > &v) {
  v.push_back(pair<double, int>(0.5, 0));
  int m = v.size();
  sort(v.begin(), v.end());
  v.push_back(pair<double, int>(2.0, 0));
  int c = 0;
  for (int i = 0; i < m; ++i) {
    if (v[i].first > 1.0 - 1e-7) return true;
    if (c == 0 && v[i].first > 1e-7) {
      if (v[i + 1].first - v[i].first > 1e-7) {
        return false;
      }
    }
    c -= v[i].second;
  }
  return true;
}
int solve() {
  int ans = n;
  vector<vector<double> > mins(n, vector<double>(n, 2.0));
  vector<vector<double> > maxs(n, vector<double>(n, -1.0));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i == j) {
        continue;
      }
      if (!checkarg(plg[i], plg[i + 1], plg[j], plg[(i - 1 + n) % n])) {
        continue;
      }
      vector<intrinfo> v;
      for (int k = 0; k < n; ++k) {
        vector<double> ret = intersect_hl_s(plg[i], plg[j], plg[k], plg[k + 1]);
        for (int u = 0; u < ret.size(); u += 2) {
          v.push_back((intrinfo){ret[u], k, ret[u + 1]});
        }
      }
      sort(v.begin(), v.end());
      for (int k = 0; k < v.size(); ++k) {
        int q = v[k].idx;
        mins[i][q] = min(mins[i][q], v[k].s);
        maxs[i][q] = max(maxs[i][q], v[k].s);
        if (abs(v[k].s) > 1e-7 && abs(v[k].s - 1.0) > 1e-7) {
          v.resize(k + 1);
          break;
        }
      }
    }
  }
  for (int S = (1 << n) - 1; S > 0; --S) {
    int cnt = 0;
    vector<vector<pair<double, int> > > imos(n);
    for (int i = 0; i < n; ++i) {
      if (!(S >> i & 1)) continue;
      ++cnt;
      for (int j = 0; j < n; ++j) {
        if (mins[i][j] + 1e-7 < maxs[i][j]) {
          imos[j].push_back(pair<double, int>(mins[i][j], -1));
          imos[j].push_back(pair<double, int>(maxs[i][j], 1));
        }
      }
    }
    if (cnt >= ans) continue;
    bool ok = true;
    for (int i = 0; i < n; ++i) {
      if (!checkrange(imos[i])) {
        ok = false;
        break;
      }
    }
    if (ok) {
      ans = cnt;
    }
  }
  return ans;
}
int main() {
  pi = acos(-1.0);
  double x, y;
  while (scanf("%d", &n), n) {
    plg.resize(n + 1);
    for (int i = 0; i < n; ++i) {
      scanf("%lf%lf", &x, &y);
      plg[i] = complex<double>(x, y);
    }
    plg[n] = plg[0];
    printf("%d\n", solve());
  }
}
