using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace D
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            if (n > 2)
            {
                for (int i = 0; i < n; i++)
                {
                    string[] t = Console.ReadLine().Split(' ');
                }
                Console.WriteLine(0);
            }
            else
            {
                string[] s = Console.ReadLine().Split(' ');
                int x1 = int.Parse(s[0]), y1 = int.Parse(s[1]);
                int japan = 0;
                if (n == 1 && x1 == 0 && y1 == 0) Console.WriteLine(1);
                else if (n == 2)
                {
                    s = Console.ReadLine().Split(' ');
                    int x2 = int.Parse(s[0]), y2 = int.Parse(s[1]);
                    int m = (y2 - y1) / (x2 - x1), sum = 0;
                    if (y1 == m * x1) sum++;
                    if (x1 == 0 && y1 == 0) sum++;
                    if (x2 == 0 && y2 == 0) sum++;
                    Console.WriteLine(sum);
                }
                else Console.WriteLine(japan);
            }
        }
    }
}