a, b =map(int, input().split()) a, b =map(int, input().split()) c, d =map(int, input().split()) import math print(math.abs(a-c)+math.abs(b-d))