#include <iostream>
#include <vector>
#include <complex>
#include <algorithm>
using namespace std;
static const double EPS = 1e-10;
typedef long long ll;
#define REP(i, s, e) for ( int i = s; i <= e; i++ )  
 
const double INF = 1e12;
typedef complex<double> P,point;
typedef vector<P> G,polygon;
namespace std {bool operator < (const P& a, const P& b) {return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);} }
double cross(const P& a, const P& b) {return imag(conj(a)*b);}
double dot(const P& a, const P& b) {return real(conj(a)*b);}
struct L : public vector<P> {L(const P &a, const P &b) {push_back(a); push_back(b);} };
int ccw(P a, P b, P 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;
}

 
// Check Funcs //
bool intersectLL(const L &l, const L &m) {return abs(cross(l[1]-l[0], m[1]-m[0])) > EPS || abs(cross(l[1]-l[0], m[0]-l[0])) < EPS;}
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 intersectLP(const L &l, const P &p) {return abs(cross(l[1]-p, l[0]-p)) < 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;}
bool intersectSP(const L &s, const P &p) {return abs(s[0]-p)+abs(s[1]-p)-abs(s[1]-s[0]) < EPS;}
 
P projection(const L &l, const P &p) {
  double t = dot(p-l[0], l[0]-l[1]) / norm(l[0]-l[1]);
  return l[0] + t*(l[0]-l[1]);
}

double distanceSP(const L &s, const P &p) {
  const P r = projection(s, p);
  if (intersectSP(s, r)) return abs(r - p);
  return min(abs(s[0] - p), abs(s[1] - p));
}
double distanceSS(const L &s, const L &t) {
  if (intersectSS(s, t)) return 0;
  return min(min(distanceSP(s, t[0]), distanceSP(s, t[1])),
             min(distanceSP(t, s[0]), distanceSP(t, s[1])));
}

// Where is Point in Polygon? //
#define curr(P, i) P[i]
#define next(P, i) P[(i+1)%P.size()]
enum { OUT, ON, IN };
int contains(const polygon& P, const point& p) {
	bool in = false;
	for (int i = 0; i < P.size(); ++i) {
		point a = curr(P,i) - p, b = next(P,i) - p;
		if (imag(a) > imag(b)) swap(a, b);
		if (imag(a) <= 0 && 0 < imag(b))
			if (cross(a, b) < 0) in = !in;
		if (cross(a, b) == 0 && dot(a, b) <= 0) return ON;
	}
	return in ? IN : OUT;
}
P 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]);
}

pair<int,int> v[65536];
int main(){
	for(int i = 0 ; i < (1<<16) ; i++){
		v[i] = make_pair(__builtin_popcount(i),i);
	}
	sort(v,v+65536);
	int N;
	while(cin >> N && N){
		vector<P> po(N);
		vector<P> chk;
		for(int i = 0 ; i < N ; i++){
			cin >> po[i].real() >> po[i].imag();
			chk.push_back(po[i]);
		}
		for(int i = 0 ; i < N ; i++){
			for(int j = i+1 ; j < N ; j++){
				for(int k = 0 ; k < N ; k++){
					L a = L(curr(po,k),next(po,k));
					L b = L(po[i],po[j]);
					if( intersectLS(b,a) ){
						chk.push_back(crosspoint(a,b));
					}
				}
			}
		}
		sort(chk.begin(),chk.end());
		vector<P> np;
		np.push_back(chk[0]);
		for(int i = 1 ; i < chk.size() ; i++){
			if( abs(chk[i]-chk[i-1]) > EPS ) np.push_back(chk[i]);
		}
		chk = np;
		
		
		vector<int> canreach(chk.size());
		for(int i = 0 ; i < chk.size() ; i++){
			//cout << chk[i] << " ";
			for(int j = 0 ; j < N ; j++){
				L l = L(chk[i],po[j]);
				
				//とりあえず中点が外部にあったら外側を走っていることは確定するのでcontinue;
				if( contains(po,0.5*(chk[i]+po[j])) == OUT ) continue; 
				
				int ok = 1;
				for(int k = 0 ; k < N ; k++){
					L a = L(curr(po,k),next(po,k));
					if( intersectSP(a,chk[i])|| intersectSP(a,po[j]) ) continue;
					if( intersectSS(a,l) ){
						P cp = crosspoint(a,l);
						
						if( abs(cp-curr(po,k)) > EPS && abs(cp-next(po,k)) > EPS ){
							ok = 0;
							break;
						}
					}
				}
				canreach[i] |= (ok<<j);
			}
			//chk[i]は辺上の点なので、少なくともある頂点(a,b)を結ぶ辺上にあるならばaとbにはたどり着ける。
			for(int k = 0 ; k < N ; k++){
				L a = L(curr(po,k),next(po,k));
				if( intersectSP(a,chk[i]) ){
					canreach[i] |= 1<<(k);
					canreach[i] |= 1<<((k+1)%N);
				}
			}
		}
		
		int ans = 1e9;
		for(int I = 0 ; I < (1<<16) ; I++){
			int i = v[I].second;
			int flag = 1;
			for(int j = 0 ; j < chk.size() ; j++){
				if( !(canreach[j]&i) ) flag = 0;
			}
			if( flag ){
				cout << v[I].first << endl;
				break;
			}
		}
				
	}
}

Measured memory_bytes: 1832