import java.util.Scanner;
import static java.lang.Math.abs;
import static java.lang.Math.pow;
/*
* AUTOR Bogdan Bozic
* Osma Beogradska Gimnazija
* 3 godina
* */
public class Kvadrat {
    
    public static void main(String[] args) {
        int x1, y1, x2, y2;
        Scanner sc = new Scanner(System.in);
        x1 = sc.nextInt();
        y1 = sc.nextInt();
        x2 = sc.nextInt();
        y2 = sc.nextInt();
        final int min = (int) pow(-10, 9);
        final int max = (int) pow(10, 9);
        if (x1 > min && x1 < max && y1 > min && y1 < max && x2 > min && x2 < max && y2 > min && y2 < max) {

            if (x1 == x2 || y1 == y2) {
                System.out.println(2);
            } else if (abs(x1 - x2) == abs(y1 - y2)) {
                System.out.println(1);
            } else {
                System.out.println("Zadane tacke ne mogu da formiraju kvadrat");
            }
        } else {
            System.out.println("Koorninate su van opsega");
        }

    }
}