#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define llong long long int main() { llong x, y, x2, y2; cin >> x >> y >> x2 >> y2; if(x == y && x2 == y2 && x*x2 >= 0) { cout << x+1 << "\n"; } else { cout << max(abs(x), abs(y)) << "\n"; } }