import strutils, sequtils proc getInts: tuple[x, y: int] = let t = stdin.readLine.split.map parseInt result = (t[0], t[1]) let (x, y) = getInts() (x2, y2) = getInts() var offset = 0 if x == y and x2 == y2 and x > x2: offset += 1 echo max(x, y) + offset