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