#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i> a >> b >> c >> d; if(a == c || b == d){ cout << 1 << endl; }else if(abs(a - c) + abs(b - d) <= 3){ cout << 1 << endl; }else{ cout << 2 << endl; } return 0; }