#include <iostream>
using namespace std;
const int N = 10010;
char res[N], ans[N];
int main(){
int n;
cin >> n;
for (int i = 1; i <= n; i ++) cin >> res[i];
for (int i = 1; i <= n; i ++) cin >> ans[i];
int cnt = 0;
for (int i = 1; i <= n; i ++)
if (res[i] == ans[i]) cnt ++;
cout << cnt << endl;
return 0;
}