n = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) ans = 0 tmp = 0 for a, b in zip(A, B): if a != b: tmp += 1 else: if tmp > 0: ans += 1 tmp = 0 if tmp > 0: ans += 1 print(ans)