#define _GLIBCXX_DEBUG #include using namespace std; int main() { int A, B, C, D; cin >> A >> B >> C >> D; if(abs(C-A)+abs(D-B) <= 3 or A==C or B==D) cout << 1 << endl; else cout << 2 << endl; }