a,b,c,d=map(int,input().split()) x,y=c-a,d-b print((2,1)[(0 in (x,y)) or (abs(x)+abs(y)<4)])