a=input() x,y=map(int,input().split());a,c=map(int,input().split()) print(abs(c-x)+abs(a-y))