#include void solve() { int x1, y1, x2, y2; std::cin >> x1 >> y1 >> x2 >> y2; int ans = std::max(x1, y1); if (x1 == y1 && x2 == y2 && y2 < y1) { ans += 1; } std::cout << ans << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }