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