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