# 1412 line=input().split(" ") pos=[int(line[i]) for i in range(len(line))] distX=abs(pos[2]-pos[0]) distY=abs(pos[3]-pos[1]) if distX==0 and distY==0: times=0 elif distX==0 or distY==0: times=1 elif distX+distY<=3: times=1 else: times=2 print(times)