#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main(){ map charMapings; for(int i = 0; i < 26; i++){ char letter; string repres; cin >> letter >> repres; charMapings[letter] = repres; //cout << rep; } int n; cin >> n; map> reprezentations; for(int i = 0; i < n; i++){ string inter; cin >> inter; //cout << inter << endl; string rep = ""; for(char c: inter){ rep += charMapings[c]; } //cout << rep << endl; auto it = reprezentations.find(rep); if(it == reprezentations.end()){ vector aux; aux.push_back(inter); reprezentations[rep] = aux; } else { reprezentations[rep].push_back(inter); } } int maxx = INT_MIN; for(auto p: reprezentations){ //cout << p.second.size() << endl; int size = p.second.size(); // for(int i = 0; i < p.second.size(); i++){ // cout << p.second[i] << " "; // } // cout << endl; if(size > maxx){ maxx = size; } } cout << maxx << endl; return 0; }