using System;
class HelloWorld
{
    static double P_trougla(long ax, long ay, long bx, long by, long cx, long cy)
    {
        double a = Math.Sqrt((bx-cx)*(bx-cx) + (by-cy)*(by-cy));
        double b = Math.Sqrt((ax-cx)*(ax-cx) + (ay-cy)*(ay-cy));
        double c = Math.Sqrt((bx-ax)*(bx-ax) + (by-ay)*(by-ay));
        double s = (a+b+c)/2;
        double Pabc = Math.Sqrt(s*(s-a)*(s-b)*(s-c));
        return Pabc;
    }
    static void Main()
    {
        long N = long.Parse(Console.ReadLine());
        if(N==3)
        {
            string [] ulaz = Console.ReadLine().Split(' ');
            long ax = long.Parse(ulaz[0]);
            long ay = long.Parse(ulaz[1]);
            
            ulaz = Console.ReadLine().Split(' ');
            long bx = long.Parse(ulaz[0]);
            long by = long.Parse(ulaz[1]);
            
            ulaz = Console.ReadLine().Split(' ');
            long cx = long.Parse(ulaz[0]);
            long cy = long.Parse(ulaz[1]);
            
            if(ax == 0 && bx == 0 && cx == 0)
            {
                long min = ay, max = ay;
                if(by < min)
                {
                    min = by;
                }
                if(by > max)
                {
                    max = by;
                }
                if(cy > max)
                {
                    max = cy;
                }
                if(cy < min)
                {
                    min = cy;
                }
                if(min<=0 && 0<=max)
                {
                    Console.WriteLine("1");
                }
                else
                {
                    Console.WriteLine("0");
                }
            }
            else if (ay == 0 && by == 0 && cy == 0)
            {
                long min = ax, max = ax;
                if(bx < min)
                {
                    min = bx;
                }
                if(bx > max)
                {
                    max = bx;
                }
                if(cx > max)
                {
                    max = cx;
                }
                if(cx < min)
                {
                    min = cx;
                }
                if(min<=0 && 0<=max)
                {
                    Console.WriteLine("1");
                }
                else
                {
                    Console.WriteLine("0");
                }
            }
            else
            {
                double Pabc = P_trougla(ax, ay, bx, by, cx, cy);
                double P1 = P_trougla(ax, ay, bx, by, 0, 0);
                double P2 = P_trougla(ax, ay, cx, cy, 0, 0);
                double P3 = P_trougla(bx, by, cx, cy, 0, 0);
                if(Math.Round(Pabc, 10) == Math.Round((P1 + P2 + P3), 10))
                {
                    Console.WriteLine("1");
                }
                else
                {
                    Console.WriteLine("0");
                }
            }
            
        }
        else
        {
            Console.WriteLine("0");
        }  
    }
}