#include using namespace std; class Solver { public: bool solve() { int x, y; cin >> x >> y; int xe, ye; cin >> xe >> ye; int ans = max(abs(x), abs(y)); if(abs(x) == abs(y) and abs(xe) == abs(ye)) { if(x * xe >= 0 and y * ye >= 0) { if(abs(x) > abs(xe)) ans += 2; } } cout << ans << endl; return 0; } }; int main() { cin.tie(0); ios::sync_with_stdio(false); Solver s; s.solve(); return 0; }