#include <iostream>

using namespace std;

int main()
{   
    int a,b,x,y;
    cin >> a >> b >> x >> y;
    if (x == a) cout << 2;
    if (y == b) cout << 2;
    if (x-a == y-b) cout << 1;
    

    return 0;
}