import sys input = sys.stdin.buffer.readline N = int(input()) A = list(input().split()) B = list(input().split()) ans = 0 changing = False for i in range(N): if A[i] == B[i]: if changing: changing = False ans += 1 else: changing = True if changing: ans += 1 print(ans)