#include int main(void) { int x,y,x2,y2; scanf("%d%d%d%d",&x,&y,&x2,&y2); if(x==y&&x2==y2)printf("%d",x+1); else if(x>y)printf("%d",x); else printf("%d",y); return 0; }