#include <bits/stdc++.h>
using namespace std;

long long X1, Y1, X2, Y2;

int main()
{
	scanf("%lld %lld", &X1, &Y1);
	scanf("%lld %lld", &X2, &Y2);
	if (X1 == X2 || Y1 == Y2)
    {
        printf("2\n");
    }
    else
    {
        printf("1\n");
    }
	return 0;
}