using System;

namespace Kvadrati
{
    class Program
    {
        static void Main(string[] args)
        {
            double x1, y1, x2, y2, x3, y3, duzinaStranice1, duzinaStranice2;
            int brojKvadrata;
            label1:
            Console.Clear();
            do
            {
                x1 = double.Parse(Console.ReadLine());
            } while ((x1 < -Math.Pow(10, 9)) && (x1 > Math.Pow(10, 9)));
            do
            {
                y1 = double.Parse(Console.ReadLine());
            } while ((y1 < -Math.Pow(10, 9)) && (y1 > Math.Pow(10, 9)));
            do
            {
                x2 = double.Parse(Console.ReadLine());
            } while ((x2 < -Math.Pow(10, 9)) && (x2 > Math.Pow(10, 9)));
            do
            {
                y2 = double.Parse(Console.ReadLine());
            } while ((y2 < -Math.Pow(10, 9)) && (y2 > Math.Pow(10, 9)));

            if ((x1 == x2) && (y1 == y2))
                goto label1;

            if ((x1 == x2) || (y1 == y2))
                brojKvadrata = 2;
            else
            {
                x3 = x1;
                y3 = y2;
                duzinaStranice1 = Math.Sqrt(Math.Pow(x3 - x2, 2) + Math.Pow(y3 - y2, 2));
                duzinaStranice2 = Math.Sqrt(Math.Pow(x3 - x1, 2) + Math.Pow(y3 - y1, 2));
                if (duzinaStranice1 == duzinaStranice2)
                    brojKvadrata = 1;
                else
                    brojKvadrata = 0;
            }
            Console.WriteLine(brojKvadrata);
        }
    }
}