#include using namespace std; typedef long long ll; int main() { int x, y, x2, y2; cin >> x >> y >> x2 >> y2; int ans = -1; if (abs(x2) < abs(x) && abs(y2) < abs(y)) { if (x == 0 && x2 == 0) { ans = abs(y) + 1; } else if (y == 0 && y2 == 0) { ans = abs(x) + 1; } if (abs(x) == abs(y) && abs(x2) == abs(y2) && x / abs(x) == x2 / abs(x2) && y / abs(y) == y2 / abs(y2)) { ans = abs(x) + 1; } } if(ans==-1) { ans = max(abs(x), abs(y)); } cout << ans << endl; return 0; }