n=int(input()) S=list(input()) T=list(input()) for count in range(n): if S[count]==T[count]: match_count+=1 print(match_count)