n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) ans = 0 if a[0] ^ b[0]: ans += 1 for i in range(1, n): if a[i] != b[i] and a[i-1] == b[i-1]: ans += 1 print(ans)