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