import java.awt.Point;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
import java.util.Scanner;

/**
 * Validator for Surveillance, making sure that the polygon doesn't intersect itself, is CCW, 
 * and alternates horizontal and vertical edges..
 * Everything else is checked by the VIVA pattern.
 *
 * @author vanb
 */
public class surveillance_validator
{
    /**
     * See if x is between a and b.
     * 
     * @param x
     * @param a
     * @param b
     * @return true if x is between a and b, false otherwise
     */
    private static boolean between( int x, int a, int b )
    {
        int lo = Math.min( a, b );
        int hi = Math.max( a, b );
        return lo<=x && x<=hi;
    }
    
    /**
     * Main.
     *
     * @param args unused
     * @throws Exception the exception
     */
    public static void main( String[] args ) throws Exception
    {
        Scanner sc = new Scanner( System.in );
        
        int n = sc.nextInt();
                
        Point points[] = new Point[n];
        
        for( int i=0; i<n; i++ )
        {
            int x = sc.nextInt();
            int y = sc.nextInt();
            points[i] = new Point(x,y);
        }
        
        int minx = 10000;
        int miny = 10000;
        int mini = -1;
        boolean ok = true;
        for( int i=0; i<n; i++ ) 
        {    
            Point pi = points[i];
            Point ni = points[(i+1)%n];  
            Point nn = points[(i+2)%n];
            
            // We need to find the lowest leftmost point
            if( pi.x<minx || (pi.x==minx && pi.y<miny) )
            {
                minx = pi.x;
                miny = pi.y;
                mini = i;
            }
            
            boolean ihorz = pi.y==ni.y;
            boolean ivert = pi.x==ni.x;
            boolean nhorz = ni.y==nn.y;
            
            // Test that edge i is either horizontal or vertical
            if( !(ihorz ^ ivert) ) ok = false; 
            
            // Test that edges i and i+1 are opposites
            if( !(ihorz ^ nhorz) ) ok = false; 
            
            // Adjacent edges are guaranteed to intesect, so skip them.
            for( int j=i+2; j<n; j++ ) if( i!=(j+1)%n && j!=(i+1)%n )
            {
                Point pj = points[j];
                Point nj = points[(j+1)%n];
             
                boolean jhorz = pj.y==nj.y;
                boolean jvert = pj.x==nj.x; 
                            
                if( ihorz & jvert )
                {
                    // Make sure horizontal i doesn't intersect vertical j
                    if( between(pi.y,pj.y,nj.y) && between(pj.x,pi.x,ni.x) ) ok = false; 
                }
                else if( ivert & jhorz )
                {
                    // Make sure horizontal j doesn't intersect vertical i
                    if( between(pj.y,pi.y,ni.y) && between(pi.x,pj.x,nj.x) ) ok = false;              
                }
            }  
        }
        
        // If the next point from the min is horizontal,
        // then this polygon is clockwise, not counter.
        if( points[mini].x == points[(mini+1)%n].x ) ok = false;;
        
        sc.close();
        
        System.exit( ok ? 42 : 0 );
    }

}
