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