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