#include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ll long long #define INF (1 << 30) #define INFLL (1LL << 60) int main() { int x1,x2,y1,y2; cin >> x1 >> y1; cin >> x2 >> y2; if(x2 < x1 && y2 < y1 && x1 > 0 && y1 > 0 && x1 == y1 && x2 == y2) cout << max(x1,y1) + 1 << endl; else if(x2 > x1 && y2 > y1 && x1 < 0 && y1 < 0 && x1 == y1 && x2 == y2) cout << max(-x1,-y1) + 1 << endl; else if(x2 < x1 && y2 > y1 && x1 > 0 && y1 < 0 && x1 == -y1 && x2 == -y2) cout << max(x1,y1) + 1 << endl; else if(x2 > x1 && y2 < y1 && x1 < 0 && y1 > 0 && -x1 == y1 && -x2 == y2) cout << max(x1,y1) + 1 << endl; else cout << max(abs(x1),abs(y1)) << endl; return 0; }