import strutils proc input: string = while true: let t = stdin.readChar if t == '\r': discard elif t.isSpaceAscii: break else: result.safeAdd t let x, y, x2, y2 = input().parseInt var offset = 0 if x == y and x2 == y2 and x > x2: offset += 1 echo max(x, y) + offset