#include #include using namespace std; int main(void){ int x, y, hx, hy; cin >> x >> y >> hx >> hy; int a = max(x, y); if (hx < x && hx == hy){ cout << a + 1 << endl; } else cout << a << endl; return 0; }