#include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(x, to) for (int x = 0; x < (to); x++) #define REP(x, a, to) for (int x = (a); x < (to); x++) #define foreach(itr, x) for (typeof((x).begin()) itr = (x).begin(); itr != (x).end(); itr++) using namespace std; typedef long long ll; typedef pair PII; typedef pair PLL; ll x, y; ll x2, y2; ll ans; int main() { cin >> x >> y; cin >> x2 >> y2; ll tmp = min(abs(x), abs(y)); ans = tmp + (abs(x)-tmp) + (abs(y)-tmp); // 途中に歩兵 if (x * x2 + y * y2 > 0 && x * x2 - y * y2 == 0) { ans += 2; } cout << ans << endl; return 0; }