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