#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const double INF = 1e12;
const double BIGEPS = 1e-5;
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);
}
struct L : public vector<complex<double> > {
  L(const complex<double> &a, const complex<double> &b) {
    push_back(a);
    push_back(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 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 intersectSP(const L &s, const complex<double> &p) {
  return abs(s[0] - p) + abs(s[1] - p) - abs(s[1] - s[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];
  return m[0] + B / A * (m[1] - m[0]);
}
vector<complex<double> > wolf;
vector<int> at;
int x[16];
int y[16];
complex<double> cv[16];
int ok[10000];
int main() {
  int a;
  while (scanf("%d", &a), a) {
    wolf.clear();
    at.clear();
    for (int i = 0; i < a; i++) {
      scanf("%d%d", x + i, y + i);
      cv[i] = complex<double>(x[i], y[i]);
    }
    for (int i = 0; i < a; i++) {
      for (int j = 0; j < a; j++) {
        if (intersectLS(L(cv[i], cv[(i + 1) % a]), L(cv[j], cv[(j + 1) % a]))) {
          complex<double> V =
              crosspoint(L(cv[i], cv[(i + 1) % a]), L(cv[j], cv[(j + 1) % a]));
          complex<double> W = V;
          V +=
              BIGEPS * (cv[j] - cv[(j + 1) % a]) / abs(cv[j] - cv[(j + 1) % a]);
          W -=
              BIGEPS * (cv[j] - cv[(j + 1) % a]) / abs(cv[j] - cv[(j + 1) % a]);
          if (intersectSP(L(cv[j], cv[(j + 1) % a]), V)) {
            wolf.push_back(V);
            at.push_back(j);
          }
          if (intersectSP(L(cv[j], cv[(j + 1) % a]), W)) {
            wolf.push_back(W);
            at.push_back(j);
          }
        }
      }
    }
    int n = wolf.size();
    for (int i = 0; i < n; i++) ok[i] = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < a; j++) {
        bool OK = true;
        for (int k = 0; k < a; k++) {
          if (at[i] == k || j == k || j == (k + 1) % a) continue;
          if (intersectSS(L(cv[k], cv[(k + 1) % a]), L(cv[j], wolf[i])))
            OK = false;
        }
        if (OK) ok[i] += (1 << j);
      }
    }
    int ret = 9999999;
    for (int i = 0; i < (1 << a); i++) {
      bool OK = true;
      for (int j = 0; j < n; j++)
        if (!(ok[j] & i)) OK = false;
      if (OK) ret = min(ret, __builtin_popcount(i));
    }
    printf("%d\n", ret);
  }
}
