#include <iostream>

using namespace std;

int main()
{

    unsigned long int ax, ay, bx, by;


    cin>>ax>>ay;
    cin>>bx>>by;


    if(ax==bx || ay==by)
        cout<<2;
    else
        cout<<1;





    return 0;
}