#include #include using namespace std; using namespace atcoder; using ll = long long; using ld = long double; int a, b, c, d; int dx[12] = {-1, -1, 1, 1, -2, -2, -1, -1, 1, 1, 2, 2}; int dy[12] = {-1, 1, -1, 1, -1, 1, -2, 2, -2, 2, -1, 1}; int main() { cin >> a >> b >> c >> d; if (a == c || b == d) { cout << 1 << endl; return 0; } for (int i = 0; i < 12; i++) { if (a + dx[i] == c && b + dy[i] == d) { cout << 1 << endl; return 0; } } cout << 2 << endl; return 0; }