#include <iostream>
#include <vector>
#include <utility>
#include <complex>
using namespace std;
using D = long double;
using P = complex<D>;
using Poly = vector<P>;
using L = pair<P,P>;
#define X real()
#define Y imag()
constexpr D EPS = 1e-10;

void debug(Poly p){
  cerr << "Polygon" << endl;
  for(auto e : p) cerr << e.X << " " << e.Y << endl;
  cerr << "..." << endl;
}

void debug(L l){
  fprintf(stderr,"Segment %Lf %Lf %Lf %Lf\n",l.first.X,l.first.Y,l.second.X,l.second.Y);
}

D dot(const P &a, const P &b){ return a.X*b.X + a.Y*b.Y; }
D cross(const P &a, const P &b){ return a.X*b.Y - a.Y*b.X; }

P intersection(const L &a, const L &b){
  P af = a.first, as = a.second, bf = b.first, bs = b.second;
  return af + cross(bs-bf,af-bf)/(-cross(bs-bf,as-bf)+cross(bs-bf,af-bf))*(as-af);
}

int ccw(P a, P b, P c){
  b -= a, c -= a;
  if(cross(b,c) > +EPS) return +1;
  if(cross(b,c) < -EPS) return -1;
  if(dot(b,c) < +EPS) return +2;
  if(norm(b) + EPS < norm(c)) return -2;
  return 0;
}

Poly convex_cut(const Poly &p, const L &l){
  // debug(p);
  // debug(l);
  Poly ret;
  int n = p.size();
  for(int i = 0; i < n; ++i){
    P cur = p[i], nex = p[(i+1)%n], lf = l.first, ls = l.second;
    if(ccw(lf,ls,cur) != -1)
      ret.push_back(cur);
    if((ccw(lf,ls,cur) != -1) ^ (ccw(lf,ls,nex) != -1))
      ret.push_back(intersection(L(cur,nex),l));
  }
  //debug(ret);
  //cerr << endl;
  return ret;
}

D area(const Poly &p){
  int n = p.size();
  D ret = 0;
  for(int i = 0; i < n; ++i){
    ret += cross(p[i],p[(i+1)%n]);
  }
  return ret/2;
}

int main(){
  int n;
  while(cin >> n, n){
    Poly p;
    for(int i = 0; i < n; ++i){
      D x, y;
      cin >> x >> y;
      p.emplace_back(x,y);
    }
    Poly S = {P(-10,-10),P(10010,-10),P(10010,10010),P(-10,10010)};
    for(int i = 0; i < n; ++i){
      S = convex_cut(S,L(p[i],p[(i+1)%n]));
      //cerr << S.size() << endl;
      // debug(L(p[i],p[(i+1)%n]));
      // debug(S);
    }
    if(area(S) < EPS) cout << 0 << endl;
    else cout << 1 << endl;
  }
}

