a,b,c,d=map(int,input().split()) if a==c or b==d: print(1) exit() if (a-c)**2 + (b-d)**2 <= 5: print(1) exit() print(2)