#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <cassert>
#include <map>
#include <set>
#include <complex>
using namespace std;
using ld = long double;
using P = complex<ld>;
using G = vector<P>;
const ld pi = acos(-1);
const ld eps = 1e-10;
const ld inf = 1e12;


ld cross(const P& a, const P& b) { return a.real()*b.imag() - a.imag()*b.real(); }
ld dot(const P& a, const P& b) { return a.real()*b.real() + a.imag()*b.imag(); }

enum { CCW = +1, CW = -1, BEHIND = +2, FRONT = -2, ON = 0 };
int ccw(P a, P b, P c) {
	b -= a; c -= a;
	if(cross(b, c) > eps)  return CCW;    // counter clockwise
	if(cross(b, c) < -eps) return CW;     // clockwise
	if(dot(b, c) < 0)      return BEHIND; // c--a--b on line
	if(norm(b) < norm(c))  return FRONT;  // a--b--c on line
	return ON;
}

struct L : public vector<P> {
	L(const P &a = 0, const P &b = 0) {
		push_back(a); push_back(b);
	}
	L(ld A, ld B, ld C) { // Ax + By + C = 0
		if(A < eps) *this = L(P(0, -C / B), P(1, -C / B));
		else if(B < eps) *this = L(P(-C / A, 0), P(-C / A, 1));
		*this = L(P(0, -C / B), P(-C / A, 0));
	}
	int ccw(const P& p) {
		return ::ccw((*this)[0], (*this)[1], p);
	}
};

P crosspointLL(const L &l, const L &m) {
	ld A = cross(l[1] - l[0], m[1] - m[0]);
	ld B = cross(l[1] - l[0], l[1] - m[0]);
	if(abs(A) < eps && abs(B) < eps) return m[0]; // same line
	if(abs(A) < eps) assert(false); // !!!PRECONDITION NOT SATISFIED!!!
	return m[0] + B / A * (m[1] - m[0]);
}

#define curr(pol, i) pol[i]
#define next(pol, i) pol[(i+1)%pol.size()]
G convex_cut(const G& pol, const L& l) {
	G res;
	for(int i = 0; i < pol.size(); ++i) {
		P A = curr(pol, i), B = next(pol, i);
		if(ccw(l[0], l[1], A) != -1) res.push_back(A);
		if(ccw(l[0], l[1], A)*ccw(l[0], l[1], B) < 0)
			res.push_back(crosspointLL(L(A, B), l));
	}
	return res;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n;
	while(cin >> n, n) {
		G g;
		for(int i = 0; i < n; i++) {
			ld x, y;
			cin >> x >> y;
			g.push_back(P(x, y));
		}

		G cut;
		cut.push_back(P(-1, 100000));
		cut.push_back(P(-1, -100000));
		cut.push_back(P(100000, 100000));
		cut.push_back(P(100000, -100000));

		bool ok = true;
		for(int i = 0; i < n; i++) {
			L l = L(g[i], g[(i + 1) % n]);
			cut = convex_cut(cut, l);
			if(cut.size() < 3) {
				ok = false;
				break;
			}
		}

		cout << 0 + ok << endl;
	}
}