def RunLengthEncoding(S): res = [] N = len(S) i = 0 while i < N: cnt = 1 while i < N - 1 and S[i] == S[i + 1]: cnt += 1 i += 1 res.append((S[i], cnt)) i += 1 return res N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) dif = [int(a != b) for a, b in zip(A, B)] ans = 0 for k, v in RunLengthEncoding(dif): if k == 1: ans += 1 print(ans)