#include <bits/stdc++.h>
using namespace std;
class Point {
 public:
  double x, y;
  Point(double x = (INT_MAX), double y = (INT_MAX)) : x(x), y(y) {}
  Point operator+(Point p) { return Point(x + p.x, y + p.y); }
  Point operator-(Point p) { return Point(x - p.x, y - p.y); }
  Point operator*(double a) { return Point(a * x, a * y); }
  Point operator/(double a) { return Point(x / a, y / a); }
  Point operator*(Point a) {
    return Point(x * a.x - y * a.y, x * a.y + y * a.x);
  }
  bool operator<(const Point& p) const {
    return !(fabs((x) - (p.x)) < (1e-6)) ? x < p.x : y < p.y;
  }
  bool operator==(const Point& p) const {
    return fabs(x - p.x) < (1e-6) && fabs(y - p.y) < (1e-6);
  }
};
struct Segment {
  Point p1, p2;
  Segment(Point p1 = Point(), Point p2 = Point()) : p1(p1), p2(p2) {}
  bool operator==(const Segment& p) const { return p.p1 == p1 && p.p2 == p2; }
};
double dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
double cross(Point a, Point b) { return a.x * b.y - a.y * b.x; }
double norm(Point a) { return a.x * a.x + a.y * a.y; }
double abs(Point a) { return sqrt(norm(a)); }
int ccw(Point p0, Point p1, Point p2) {
  Point a = p1 - p0, b = p2 - p0;
  if (cross(a, b) > (1e-6)) return 1;
  if (cross(a, b) < -(1e-6)) return -1;
  if (dot(a, b) < -(1e-6)) return 2;
  if (norm(a) < norm(b)) return -2;
  return 0;
}
bool intersectSS(Segment s, Segment t) {
  return ccw(s.p1, s.p2, t.p1) * ccw(s.p1, s.p2, t.p2) <= 0 &&
         ccw(t.p1, t.p2, s.p1) * ccw(t.p1, t.p2, s.p2) <= 0;
}
int n;
vector<Point> poly;
bool check(int state) {
  int result = 0;
  vector<int> sp;
  for (int i = 0; i < n; i++)
    if ((state >> i) & 1) sp.push_back(i), result |= (1 << i);
  int loop = ((1 << n) - 1) & ~state;
  while (loop) {
    int OK = loop & -loop;
    loop -= OK;
    int use = log2(OK);
    for (int i = 0; i < sp.size(); i++) {
      bool ok = true;
      for (int j = 0; j < poly.size(); j++) {
        if (j == sp[i] || j == use || (j + 1) % poly.size() == sp[i] ||
            (j + 1) % poly.size() == use)
          continue;
        if (intersectSS(Segment(poly[use], poly[sp[i]]),
                        Segment(poly[j], poly[(j + 1) % poly.size()]))) {
          ok = false;
          break;
        }
      }
      if (ok) {
        result |= (1 << use);
        break;
      }
    }
  }
  return result == (1 << n) - 1;
}
int main() {
  while (cin >> n, n) {
    poly.resize(n);
    for (Point& p : poly) {
      cin >> p.x >> p.y;
      p.x += 1000, p.y += 1000;
    }
    int ans = n;
    for (int i = 1; i < (1 << n); i++) {
      int cost = __builtin_popcount(i);
      if (cost >= ans) continue;
      if (check(i)) ans = min(ans, cost);
    }
    cout << ans << endl;
  }
  return 0;
}
