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