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