n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) c = [] same = True ans = 0 for i in range(n): if (a[i] == b[i]): same = True else: if (same == True): same = False ans += 1 print(ans)