#include <algorithm>
#include <vector>
#include <cfloat>
#include <string>
#include <cmath>
#include <set>
#include <cstdlib>
#include <map>
#include <ctime>
#include <iomanip>
#include <functional>
#include <deque>
#include <iostream>
#include <cstring>
#include <queue>
#include <cstdio>
#include <stack>
#include <climits>
#include <sys/time.h>
#include <cctype>

using namespace std;

typedef long long ll;

#define EPS (1e-10)
#define equals(a, b) (fabs((a)-(b)) < EPS)

class Point {
 public:
  double x, y;

  Point(double x = 0, double y = 0): 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); }

  double norm() { return x*x+y*y; }
  double abs() { return sqrt(norm()); }

  bool operator < (const Point &p) const {
    return x != p.x ? x < p.x : y < p.y;
  }

  bool operator == (const Point &p) const {
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
  }
};

typedef Point Vector;
typedef vector <Vector> Polygon;

class Segment {
 public:
  Point p1, p2;

  Segment(Point p1 = Point(), Point p2 = Point()): p1(p1), p2(p2) {}
};

double norm(Vector a) {
  return a.x*a.x+a.y*a.y;
}

double abs(Vector a) {
  return sqrt(norm(a));
}

double getDistance(Point a, Point b) {
  return abs(a-b);
}

double cross(Vector a, Vector b) {
  return a.x*b.y-a.y*b.x;
}
double dot(Vector a, Vector b) {
  return a.x*b.x+a.y*b.y;
}


Point getCrossPoint(Segment s1, Segment s2) {
  Vector base = s2.p2-s2.p1;
  double d1 = abs(cross(base, s1.p1-s2.p1));
  double d2 = abs(cross(base, s1.p2-s2.p1));
  double t = d1/(d1+d2);
  return s1.p1+(s1.p2-s1.p1)*t;
}

int ccw(Point p0, Point p1, Point p2) {
  Vector a = p1-p0;
  Vector b = p2-p0;
  if (cross(a, b) > EPS) return 1;
  if (cross(a, b) < -EPS) return -1;
  if (dot(a, b) < -EPS) return 2;
  if (a.norm() < b.norm()) return -2;

  return 0;
}

bool intersect(Point p1, Point p2, Point p3, Point p4) {
  return (ccw(p1, p2, p3)*ccw(p1, p2, p4) <= 0 &&
          ccw(p3, p4, p1)*ccw(p3, p4, p2) <= 0);
}
bool intersect(Segment s1, Segment s2) {
  return intersect(s1.p1, s1.p2, s2.p1, s2.p2);
}

// poly???????¨?????????????????¨???????????????????????????´???l??§?????£????????´???????????????????????????
// ?????´?????????????????´????????´???l??????????????????????????°??????swap(l[0], l[1])
Polygon convex_cut(Polygon poly, Segment l) {
  Polygon ret;
  for (int i = 0; i < poly.size(); i++) {
    Vector a = poly[i], b = poly[(i+1)%poly.size()];
    if (ccw(l.p1, l.p2, a) != -1) ret.push_back(a);  // ????¨?????????§???????????°??????
    if (ccw(l.p1, l.p2, a)*ccw(l.p1, l.p2, b) < 0) { // ??????????????´?????????????????????
      ret.push_back(getCrossPoint(Segment(a, b), l));
    }
  }
  return ret;
}


int main() {
  while (true) {
    int n;
    cin >> n;
    if (n == 0) break;

    Polygon poly;
    for (int i = 0; i < n; i++) {
      double x, y;
      cin >> x >> y;
      poly.push_back(Vector(x, y));
    }
    Polygon field;
    field.push_back(Vector(-10, -10));
    field.push_back(Vector(1e6, -10));
    field.push_back(Vector(1e6, 1e6));
    field.push_back(Vector(-10, 1e6));
    
    bool star = true;
    for (int i = 0; i < n; i++) {
      Segment s1;
      s1.p1 = poly[i];
      s1.p2 = poly[(i+1)%n];
      
      field = convex_cut(field, s1);
      if (field.size() == 0) {
        star = false;
        break;
      }
    }

    if (star) {
      cout << 1 << endl;
    }else {
      cout << 0 << endl;
    }
  }
}

Measured memory_bytes: 1236