N=int(input()) S=list(map(int,list(input()))) T=list(map(int,list(input()))) cnt0=sum(s^t for s,t in zip(S,T)) cnt1=sum(s^t for s,t in zip(S[::-1],T)) inf=1<<30 ans=inf if cnt0%2==0: ans=min(ans,cnt0) if cnt1%2: ans=min(ans,cnt1) print(ans)