#include <bits/stdc++.h>

using namespace std;

namespace {
    const double EPS = 1e-7;
    struct Point {
        double x, y;
        Point() {}
        Point(double x, double y) : x(x), y(y) {}
        Point operator+(const Point& p) const { return Point(x + p.x, y + p.y); }
        Point operator-(const Point& p) const { return Point(x - p.x, y - p.y); }
        Point operator*(double k) const { return Point(k * x, k * y); }
        Point operator/(double k) const { return Point(x / k, y / k); }
    };
    double dot(const Point& a, const Point& b) { return a.x * b.x + a.y * b.y; }
    double cross(const Point& a, const Point& b) { return a.x * b.y - a.y * b.x; }
    double norm(const Point& a) { return sqrt(dot(a, a)); }
    Point rot90(const Point& p) { return Point(-p.y, p.x); } // 反時計回りに90度回転 
    double angle(const Point& a) { return atan2(a.y, a.x); } // x軸を反時計回りに何ラジアン回転させれば点aに乗るか
    ostream& operator<<(ostream& os, const Point& p) { return os << "(" << p.x << "," << p.y << ")"; }
    istream& operator>>(istream& is, Point& p) { return is >> p.x >> p.y; }

    int ccw(Point a, Point b, Point c){
        b = b - a; c = c - a;
        if (cross(b, c) > EPS) return +1;      // a,b,cの順に反時計周り
        if (cross(b, c) < -EPS) return -1;     // a,b,cの順に時計周り
        if (dot(b, c) < 0) return +2;          // c--a--b 直線
        if (norm(b) < norm(c)) return -2;      // a--b--c 直線
        return 0;                              // a--c--b 直線
    }

    struct Line {
        Point a, b;
        Line() {}
        Line(const Point& a, const Point& b) : a(a), b(b) {}
    };
    bool contains(const Line& l, const Point& p) { return ccw(l.a, l.b, p) % 2 == 0; }
    bool parallel(const Line& s, const Line& t) { return abs(cross(s.b - s.a, t.b - t.a)) < EPS; }
    bool orthogonal(const Line& s, const Line& t) { return abs(dot(s.b - s.a, t.b - t.a)) < EPS; }
    bool equals(const Line& s, const Line& t) { return parallel(s, t) && contains(s, t.a); }
    istream& operator>>(istream& is, Line& l) { return is >> l.a >> l.b; }

    Point crosspoint(const Line& s, const Line& t) {
        double d = cross(t.b - t.a, s.b - s.a);
        assert(abs(d) >= EPS);
        return s.a + (s.b - s.a) * cross(t.b - t.a, t.b - s.a) / d;
    }

    int N;
    vector<Point> P;
    bool input() {
        cin >> N;
        if (N == 0) return false;
        P.clear(); P.resize(N);
        for (int i = 0; i < N; i++) cin >> P[i];
        return true;
    }

    int next(int n) {
        return (n + 1) % N;
    }

    bool check(Point p) {
        for (int i = 0; i < N; i++) {
            bool f = false;
            for (int d = -1; d <= 1; d += 2) {
                Point q(p.x + d * EPS, p.y + d * EPS);
                if (cross(P[i] - q, P[next(i)] - q) >= 0) f = true;
            }
            if (!f) return false;
        }
        return true;
    }

    void solve() {
        for (int i = 0; i < N; i++) {
            for (int j = i + 1; j < N; j++) {
                Line l(P[i], P[next(i)]);
                Line m(P[j], P[next(j)]);
                Point p = crosspoint(l, m);
                if (check(p)) {
                    //cout << p << endl;
                    cout << 1 << endl;
                    return;
                }
            }
        }
        cout << 0 << endl;
    }
}

int main() {
    while (input()) solve();
    return 0;
}

Measured memory_bytes: 1236