A,B,C,D=map(int,input().split())

if A==C or B==D:
    print(1)
elif abs(C-A)+abs(D-B)<=3:
    print(1)
else:
    print(2)