import sys input = sys.stdin.buffer.readline N = int(input()) A = list(input().split()) B = list(input().split()) ans = 0 changing = False for a, b in zip(A, B): if a == b: if changing: changing = False ans += 1 else: changing = True if changing: ans += 1 print(ans)