N = int(input()) A = list(map(int, input().split())) + [0] B = list(map(int, input().split())) + [0] x = 0 ans = 0 for i in range(N + 1): if A[i] == B[i] and x == 1: ans += 1 x = 0 elif A[i] != B[i] and x == 0: ans += 1 x = 1 print(ans // 2)