링크 : https://www.acmicpc.net/problem/14425
#include <iostream>
#include <map>
using namespace std;
int main(){
int N, M;
cin >> N >> M;
map<string, bool> m;
for(int i = 0; i < N; i++){
string tmp = "";
cin >> tmp;
m.insert(make_pair(tmp, true));
}
int cnt = 0;
for(int i = 0 ; i < M; i++){
string tmp = "";
cin >> tmp;
if(m[tmp] == true) cnt ++;
}
cout << cnt;
return 0;
}