import strutils, sequtils, math let xy, x2y2 = stdin.readLine.split.map parseInt (x, y) = (xy[0], xy[1]) (x2, y2) = (x2y2[0], x2y2[1]) var offset = 0 if x.abs == y.abs and x2.abs == y2.abs: if x.sgn == x2.sgn and y.sgn == y2.sgn: offset += 2 echo max(x.abs, y.abs) + offset