#include <bits/stdc++.h>
using namespace std;
long double EPS = 1e-8;
int sgn(long double a, long double b = 0) {
  return a < b - EPS ? -1 : a > b + EPS ? 1 : 0;
}
long double sqr(long double a) { return sqrt(max(a, (long double)0)); }
struct Point {
  long double add(long double a, long double b) {
    if (abs(a + b) < EPS * (abs(a) + abs(b))) return 0;
    return a + b;
  }
  long double x, y;
  Point() {}
  Point(long double x, long double y) : x(x), y(y) {}
  Point operator+(Point p) { return Point(add(x, p.x), add(y, p.y)); }
  Point operator-(Point p) { return Point(add(x, -p.x), add(y, -p.y)); }
  Point operator*(long double d) { return Point(x * d, y * d); }
  Point operator/(long double d) { return Point(x / d, y / d); }
  bool operator==(Point p) { return !sgn(dist(p)); }
  bool operator<(Point p) const { return (p.x != x) ? x < p.x : y < p.y; }
  long double norm() { return sqr(x * x + y * y); }
  long double dist(Point a) { return (*this - a).norm(); }
  long double dot(Point a) { return x * a.x + y * a.y; }
  long double cross(Point a) { return x * a.y - y * a.x; }
};
int ccw(Point a, Point b, Point c) {
  b = b - a;
  c = c - a;
  if (b.cross(c) > 0) return +1;
  if (b.cross(c) < 0) return -1;
  if (b.dot(c) < 0) return +2;
  if (b.norm() < c.norm()) return -2;
  return 0;
}
int visible(Point a, Point b, Point c) {
  return sgn(sgn(a.cross(c)) - sgn(b.cross(c)) - sgn(a.cross(b)));
}
struct Line {
  Point a, b;
  Line() {}
  Line(Point a, Point b) : a(a), b(b) {}
  bool on(Point c) { return abs(ccw(a, b, c)) != 1; }
  long double dist(Point c) {
    return abs((b - a).cross(c - a)) / (b - a).norm();
  }
  bool isOrthogonal(Line l) { return (a - b).dot(l.a - l.b) == 0.0; }
  bool isParallel(Line l) { return (a - b).cross(l.a - l.b) == 0.0; }
  bool isIntersection(Line l) { return !((a - b).cross(l.a - l.b) == 0.0); }
  Point intersectionPoint(Line l) {
    return a +
           (b - a) * ((l.b - l.a).cross(l.a - a) / (l.b - l.a).cross(b - a));
  }
};
struct Segment : public Line {
  Segment() {}
  Segment(Point a, Point b) : Line(a, b) {}
  bool on(Point c) { return ccw(a, b, c) == 0; }
  bool on(Line l) { return l.on(a) && l.on(b); }
  bool overlap(Segment s) {
    return isParallel(s) && (on(s.a) || on(s.b) || s.on(a) || s.on(b));
  }
  bool isParallel(Segment s) { return (a - b).cross(s.a - s.b) == 0.0; }
  bool isIntersection(Segment s) {
    return (ccw(a, b, s.a) * ccw(a, b, s.b) <= 0 &&
            ccw(s.a, s.b, a) * ccw(s.a, s.b, b) <= 0);
  }
};
vector<vector<int> > g;
int rec(int id, int n, vector<int> s) {
  if (n != 0 && id > g.size()) return -1;
  if (n == 0) {
    vector<int> v;
    for (int i = 0; i < s.size(); i++) {
      for (int j = 0; j < g[s[i]].size(); j++) {
        v.push_back(g[s[i]][j]);
      }
    }
    sort((v).begin(), (v).end());
    v.erase(unique((v).begin(), (v).end()), v.end());
    return v.size();
  }
  int res = -1;
  for (int i = id; i < g.size(); i++) {
    vector<int> tmp = s;
    res = max(res, rec(i + 1, n, tmp));
    tmp.push_back(i);
    res = max(res, rec(i + 1, n - 1, tmp));
  }
  return res;
}
int main(void) {
  int n;
  while (cin >> n, n) {
    vector<Point> v(n);
    for (int i = 0; i < n; i++) {
      cin >> v[i].x >> v[i].y;
    }
    bool fg = true;
    for (int i = 0; i < n; i++) {
      for (int j = i + 2; j < i + n - 1; j++) {
        fg &= !Segment(v[(i) % v.size()], v[(i + 1) % v.size()])
                   .isIntersection(
                       Segment(v[(j) % v.size()], v[(j + 1) % v.size()]));
      }
    }
    assert(fg);
    g.clear();
    g.resize(n);
    for (int i = 0; i < n; i++) {
      Point a = v[(i + v.size() - 1) % v.size()], b = v[(i) % v.size()],
            c = v[(i + 1) % v.size()];
      for (int j = 0; j < n; j++) {
        if (i == j) continue;
        if (visible(c - b, a - b, v[j] - b) < 0) continue;
        bool fg = false;
        Segment s(v[i], v[j]);
        for (int k = 0; k < n; k++) {
          if (i == k || i == (k + 1) % n || j == k || j == (k + 1) % n)
            continue;
          if (s.overlap(Segment(v[(k) % v.size()], v[(k + 1) % v.size()])))
            continue;
          fg |= s.isIntersection(
              Segment(v[(k) % v.size()], v[(k + 1) % v.size()]));
        }
        if (fg) continue;
        g[i].push_back(j);
      }
      g[i].push_back(i);
    }
    for (int i = 1; i <= n / 3; i++) {
      if (rec(0, i, vector<int>()) == n) {
        cout << i << endl;
        break;
      }
    }
  }
  return 0;
}
