#include using namespace std; int main(){ int x,y,x2,y2; cin >> x >> y >> x2 >> y2; int ans = max(x,y); if(x == y && x2 == y2 && x > x2) ans++; cout << ans << endl; }