#include #include #include #include #include #include #include #include #include #include #define ALL(obj) (obj).begin(),(obj).end() #define RALL(obj) (obj).rbegin(),(obj).rend() #define P pair #define MOD 1000000007 #define INF 1012345678 #define NINF (-2147483647-1) #define LLINF 9223372036854775807 using ll = long long; using namespace std; int main() { int x, y, x2, y2; cin >> x >> y >> x2 >> y2; if (x == y && x2 == y2 && x > x2) { cout << x + 1 << endl; } else { cout << max(x, y) << endl; } getchar(); getchar(); return 0; }