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