#include #include using namespace std; int main(void) { int x, y, x2, y2; scanf("%d%d%d%d", &x, &y, &x2, &y2); int res = max(x, y); if(x==y && x2==y2 && x>x2) { res++; } printf("%d\n", res); return 0; }