a, b, c, d = map(int, input().split()) length = abs(a - c) + abs(b - d) if length <= 3 or a == c or b == d: print(1) else: print(2)