program main implicit none integer*8::x,y,x2,y2 read *,x,y,x2,y2 if(x.eq.y.and.x2.eq.y2.and.x.gt.y2) then print '(i0)', MAX(x,y)+1 else print '(i0)', MAX(x,y) end if end program main