import math def solve(): # pの座標 p = input().split(' ') px = int(p[0]) py = int(p[1]) # qの座標 q = input().split(' ') qx = int(q[0]) qy = int(q[1]) # 交差地点の座標 ix = (qx + px) / 2 iy = (qy + py) / 2 # 交差地点座標がどちらも割り切れない場合 # x座標は切り上げ、y座標は切り捨て if ((qx + px) % 2 != 0 and (qy + py) % 2 != 0): ix = math.ceil((qx + px) / 2) iy = math.floor((qy + py) / 2) distance = abs(ix - px) + abs(iy - py) print(distance) solve()