#include "bits/stdc++.h" using namespace std; typedef long long ll; ll x, y; int main() { cin >> x >> y; int x2,y2; cin >> x2 >> y2; if (x == y && x2 == y2) { cout << x+1 << endl; } else { cout << max(abs(x), abs(y)) << endl; } }