#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define FOR(i,a,b) for(ll i=(a);i<(b);++i) #define ALL(v) (v).begin(), (v).end() #define p(s) cout<<(s)< void vprint(T &V){ for(auto v : V){ cout << v << " "; } cout << endl; } int main(){ cin.tie(0); ios::sync_with_stdio(false); // input ll x, y; cin >> x >> y; ll x2, y2; cin >> x2 >> y2; ll ans; if(x==y && x2==y2 && x2 < x){ ans = max(x, y) + 1; }else{ ans = max(x, y); } p(ans); return 0; }