import strutils proc input: string = while true: let t = stdin.readChar if t.isDigit: result.safeAdd t else: break 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