def main(): A, B, C, D = map(int, input().split()) if A == C or B == D: print(1) return if (abs(C-A) + abs(D-B)) <= 3: print(1) return print(2) if __name__ == "__main__": main()