#include using namespace std; typedef long long ll; typedef vector VI; typedef vector VVI; typedef vector VL; typedef vector VVL; typedef pair PII; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #define MOD 1000000007 #define INF (1LL << 25) // 33554432 #define PI 3.14159265359 #define EPS 1e-12 //#define int ll signed main(void) { int x, y, x2, y2; cin >> x >> y >> x2 >> y2; if (abs(x) == abs(y)) { if ((x <= 0 && y <= 0 && x2 <= 0 && y2 <= 0) || (x <= 0 && y >= 0 && x2 <= 0 && y2 >= 0) || (x >= 0 && y <= 0 && x2 >= 0 && y2 <= 0) || (x >= 0 && y >= 0 && x2 >= 0 && y2 >= 0)) { if(abs(x2) == abs(y2)) { cout << abs(x)+1 << endl; return 0; } } cout << abs(x) << endl; return 0; } else { cout << max(abs(x), abs(y)) << endl; } return 0; }