A, B, C, D = map(int, input().split()) tmp = abs(A - C) + abs(B - D) if (A == C and B != D) or (A != C and B == D): print(1) elif abs(A - C) + abs(B - D) <= 3: print(1) else: print(2)