#include <iostream>
using namespace std;
int main()
{
    long int x,y,x1,y1;cin>>x>>y>>x1>>y1;
    if(x==x1 || y==y1)
    {
        cout<<2;
    }
    else
    {
        cout<<1;
    }
    return 0;
}