#include <iostream>
#include <stdio.h>
#include <math.h>
int main()
{
    double x, y, z, u;
    scanf("%lf%lf%lf%lf", &x, &y, &z, &u);
    if (x == z || y == u) printf("2");
    else if ((z - x) == (u - y)) printf("1");
    else printf("0");
}