n = int(input()) A = list(map(int,input().split())) B = list(map(int, input().split())) C = [] for a ,b in zip(A, B): if a == b: C.append(0) else: C.append(1) X = [] cur = C[0] cnt = 0 for c in C: if c == cur: cnt += 1 else: X.append(cur) cur = c cnt = 1 else: X.append(cur) print(sum(X))