N = int(input()) S = [0] + list(map(int, input().split())) T = [0] + list(map(int, input().split())) ans = 0 for i in range(1, N+1): if (S[i] != T[i]) and (S[i-1] == T[i-1]): ans += 1 print(ans)