#include using namespace std; typedef unsigned long long ul; typedef signed long long ll; ul over = 1000000007; int main(void) { cin.tie(0); ios::sync_with_stdio(false); cout << fixed; ll x, y, x2, y2; cin >> x >> y >> x2 >> y2; ll ans = max(x, y); if (x==y && x2==y2 && x2 < x) { ans++; } cout << ans << endl; return 0; }