def fun(x0, y0, x1, y1): if x0 == x1 or y0 == y1: return 1 if abs(x1 - x0) + abs(y1 - y0) <= 3: return 1 else: return 2 a, b, c, d = map(int, input().split()) print(fun(a, b, c, d))