#include <bits/stdc++.h>
using namespace std;
vector<pair<double, double> > polygon;
vector<vector<pair<double, double> > > pts;
vector<pair<double, double> > chkpts;
vector<bitset<100> > visible_pts;
vector<bitset<100> > visible_seg;
double cross(pair<double, double> a, pair<double, double> b) {
  return a.first * b.second - a.second * b.first;
}
double dot(pair<double, double> a, pair<double, double> b) {
  return a.first * b.first + a.second * b.second;
}
template <class T>
T sqr(T first) {
  return first * first;
}
double dist(pair<double, double> a, pair<double, double> b) {
  pair<double, double> c;
  c.first = b.first - a.first;
  c.second = b.second - a.second;
  return sqrt(c.first * c.first + c.second * c.second);
}
bool eq_pt(pair<double, double> a, pair<double, double> b) {
  return dist(a, b) < 1e-9;
}
bool on_seg(pair<double, double> pt, pair<double, double> a,
            pair<double, double> b) {
  pair<double, double> c, d;
  c.first = a.first - pt.first;
  c.second = a.second - pt.second;
  d.first = b.first - pt.first;
  d.second = b.second - pt.second;
  return (dot(c, d) < 1e-9) && (fabs(cross(c, d)) < 1e-9);
}
bool parallel(pair<double, double> li0s, pair<double, double> li0t,
              pair<double, double> li1s, pair<double, double> li1t) {
  pair<double, double> a, b;
  a = make_pair(li0t.first - li0s.first, li0t.second - li0s.second);
  b = make_pair(li1t.first - li1s.first, li1t.second - li1s.second);
  return fabs(cross(a, b)) < 1e-9;
}
pair<double, double> intersection(pair<double, double> li0s,
                                  pair<double, double> li0t,
                                  pair<double, double> li1s,
                                  pair<double, double> li1t) {
  double s, t;
  pair<double, double> a, b, c;
  a = make_pair(li1s.first - li0s.first, li1s.second - li0s.second);
  b = make_pair(li1t.first - li0s.first, li1t.second - li0s.second);
  c = make_pair(li0t.first - li0s.first, li0t.second - li0s.second);
  if (fabs(cross(a, b)) < 1e-9) return li0s;
  s = cross(a, c) / cross(a, b);
  t = cross(c, b) / cross(a, b);
  return make_pair(li0s.first + c.first / (s + t),
                   li0s.second + c.second / (s + t));
}
void mkpts() {
  pts.resize(polygon.size());
  for (int i = 0; i < polygon.size(); i++) {
    pair<double, double> li0s = polygon[i];
    for (int j = 1; j < polygon.size(); j++) {
      pair<double, double> li0t = polygon[(i + j) % polygon.size()];
      for (int k = 0; k < polygon.size(); k++) {
        pair<double, double> li1s, li1t, res;
        li1s = polygon[k];
        li1t = polygon[(k + 1) % polygon.size()];
        if (parallel(li0s, li0t, li1s, li1t)) continue;
        res = intersection(li0s, li0t, li1s, li1t);
        if (on_seg(res, li1s, li1t)) pts[k].push_back(res);
      }
    }
  }
  for (int i = 0; i < polygon.size(); i++) pts[i].push_back(polygon[i]);
}
pair<double, double> cmpbase;
bool cmp(pair<double, double> a, pair<double, double> b) {
  return dist(cmpbase, a) < dist(cmpbase, b);
}
void mkchkpts() {
  for (int i = 0; i < pts.size(); i++) {
    cmpbase = polygon[i];
    sort(pts[i].begin(), pts[i].end(), cmp);
  }
  chkpts.push_back(pts[0][0]);
  for (int i = 0; i < pts.size(); i++) {
    for (int j = 0; j < pts[i].size(); j++) {
      if (dist(chkpts.back(), pts[i][j]) > 1e-9) chkpts.push_back(pts[i][j]);
    }
  }
}
bool valid_angle(int indx, pair<double, double> p) {
  int sz = polygon.size();
  pair<double, double> a, b;
  a = make_pair(polygon[indx].first - polygon[(indx - 1 + sz) % sz].first,
                polygon[indx].second - polygon[(indx - 1 + sz) % sz].second);
  b = make_pair(polygon[(indx + sz + 1) % sz].first - polygon[indx].first,
                polygon[(indx + sz + 1) % sz].second - polygon[indx].second);
  pair<double, double> aa, bb;
  aa = make_pair(p.first - polygon[(indx - 1 + sz) % sz].first,
                 p.second - polygon[(indx - 1 + sz) % sz].second);
  bb =
      make_pair(p.first - polygon[indx].first, p.second - polygon[indx].second);
  if (cross(a, b) > 0)
    return (cross(a, aa) + 1e-9 > 0) && (cross(b, bb) + 1e-9 > 0);
  else
    return (cross(a, aa) + 1e-9 > 0) || (cross(b, bb) + 1e-9 > 0);
}
bool seen(pair<double, double> a, pair<double, double> b) {
  pair<double, double> c = make_pair(b.first - a.first, b.second - a.second);
  if (eq_pt(a, b)) return true;
  for (int i = 0; i < polygon.size(); i++) {
    pair<double, double> seg0s, seg0t;
    seg0s = polygon[i];
    seg0t = polygon[(i + 1) % polygon.size()];
    if (parallel(seg0s, seg0t, a, b)) continue;
    pair<double, double> p = intersection(seg0s, seg0t, a, b);
    if (!on_seg(p, a, b) || eq_pt(p, a) || eq_pt(p, b)) continue;
    if (!on_seg(p, seg0s, seg0t)) continue;
    int indx = -1;
    for (int j = 0; j < polygon.size(); j++) {
      if (eq_pt(p, polygon[j])) {
        indx = j;
      }
    }
    if (!(indx + 1)) return false;
    int sz = polygon.size();
    pair<double, double> v, w;
    v = make_pair(polygon[(indx - 1 + sz) % sz].first - p.first,
                  polygon[(indx - 1 + sz) % sz].second - p.second);
    w = make_pair(polygon[(indx + 1) % sz].first - p.first,
                  polygon[(indx + 1) % sz].second - p.second);
    if (cross(v, c) * cross(w, c) + 1e-9 < 0) {
      return false;
    }
    if (!valid_angle(indx, b)) {
      return false;
    }
  }
  return true;
}
void mkvisible() {
  visible_pts.resize(polygon.size());
  visible_seg.resize(polygon.size());
  for (int i = 0; i < visible_pts.size(); i++) {
    visible_pts[i].reset();
    visible_seg[i].reset();
  }
  for (int i = 0; i < polygon.size(); i++) {
    for (int j = 0; j < chkpts.size(); j++) {
      if (valid_angle(i, chkpts[j]))
        visible_pts[i][j] = seen(polygon[i], chkpts[j]);
      else
        visible_pts[i][j] = false;
    }
  }
  for (int i = 0; i < visible_pts.size(); i++) {
    for (int j = 0; j < chkpts.size(); j++) {
      visible_seg[i][j] =
          visible_pts[i][j] && visible_pts[i][(j + 1) % chkpts.size()];
    }
  }
}
int solve() {
  int res, sz;
  res = sz = polygon.size();
  for (int i = 0; i < (1 << sz); i++) {
    bitset<100> bs;
    bs.reset();
    int cnt = 0;
    for (int j = 0; j < sz; j++) {
      if (i & (1 << j)) {
        cnt++;
        for (int k = 0; k < chkpts.size(); k++) {
          if (visible_seg[j][k]) bs[k] = true;
        }
      }
    }
    bool flg = true;
    for (int j = 0; j < chkpts.size(); j++) {
      flg &= bs[j];
    }
    if (flg) {
      res = min(res, cnt);
    }
  }
  return res;
}
int main() {
  int n;
  while (cin >> n, n) {
    polygon.clear();
    pts.clear();
    chkpts.clear();
    visible_pts.clear();
    visible_seg.clear();
    polygon.resize(n);
    for (int i = 0; i < n; i++) {
      cin >> polygon[i].first >> polygon[i].second;
    }
    mkpts();
    mkchkpts();
    mkvisible();
    cout << solve() << endl;
  }
}
