#include <iostream>
using namespace std;
int n, cnt;
char s[10010], c;
int main()
{
cin >> n;
for (int i = 0; i < n; i ++ ) cin >> s[i];
for (int i = 0; i < n; i ++ )
{
cin >> c;
if (c == s[i]) cnt ++;
}
cout << cnt;
return 0;
}