n = int(input()) na, nb = 0, 0 ans = 0 for x, y, r in zip(list(map(int, input().split())), list(map(int, input().split())), range(n)): if r == 0 and x ^ y: ans += 1 elif (x != y) and (na == nb): ans += 1 na, nb = x, y print(ans)