n = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) ans = 0 miss_flag = False for i in range(n): if A[i] == B[i]: if not miss_flag: ans += 1 miss_flag = True else: miss_flag = False if i == n - 1: ans += 1 print(ans)