#include #include #include using namespace std; #define RREP(i,s,e) for (int i = e-1; i >= s; i--) #define rrep(i,n) RREP(i,0,n) #define REP(i,s,e) for (int i = s; i < e; i++) #define rep(i,n) REP(i,0,n) int main() { int x1, y1, x2, y2, ans; cin >> x1 >> y1 >> x2 >> y2; ans = max(abs(x1),abs(y1)); if (x1 == 0 && x2 == 0 && abs(y1) > abs(y2) || y1 == 0 && y2 == 0 && abs(x1) > abs(x2)) ans++; else if (abs(x1) == abs(y1) && abs(x2) == abs(y2) && abs(x1) > abs(x2) && x1*x2 > 0 && y1*y2 > 0) ans++; cout << ans << endl; return 0; }