n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) cnt = 0 ans = 0 for i in range(n): if a[i] == b[i] and cnt >= 1: ans += 1 cnt = 0 elif a[i] != b[i]: cnt += 1 if cnt >= 1: ans += 1 print(ans)