n = int(input()) a = list(map(int, input().split())) for i, b in enumerate(map(int, input().split())): a[i] ^= b a = [0] + a + [0] a = [x ^ y for x, y in zip(a, a[1:])] print(a.count(1) // 2)