N = int(input()) S = list(input()) T = list(input()) cnts = cntt = 0 for c in S: if c == "1": cnts += 1 for c in T: if c == "1": cntt += 1 if abs(cnts - cntt) % 2 == 1: S.reverse() ans = 0 for i in range(N): if S[i] != T[i]: ans += 1 print(ans)