#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair i_i; typedef pair ll_i; typedef pair d_i; typedef pair ll_ll; typedef pair d_d; struct edge { int u, v; ll w; }; ll MOD = 1000000007; ll _MOD = 1000000009; double EPS = 1e-10; int main() { int x, y, x2, y2; cin >> x >> y >> x2 >> y2; if (abs(x) == abs(y) && abs(x2) == abs(y2) && x/abs(x) == x2/abs(x2) && abs(y)/y == abs(y2)/y2 && (ll)x*x+(ll)y*y > (ll)x2*x2+(ll)y2*y2) cout << max(abs(x), abs(y)) + 1 << endl; else cout << max(abs(x), abs(y)) << endl; }