def main(): x1, y1, x2, y2 = map(int, input().split()) if x1 == x2 or y1 == y2 or abs(x1 - x2) + abs(y1 - y2) <= 3: print(1) else: print(2) if __name__ == "__main__": main()