A,B,C,D=map(int,input().split()) if abs(A-C)+abs(B-D)<4 or (C,D)==(C,B) or (C,D)==(A,D): print(1) else: print(2)