input() a, b = map(int, input()) c, d = map(int, input()) print(abs(a - c) + abs(b - d))