#include<bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
string s[n];
map<char, int> m;
m['a'] = 2;
m['b'] = 2;
m['c'] = 2;
m['d'] = 3;
m['e'] = 3;
m['f'] = 3;
m['g'] = 4;
m['h'] = 4;
m['i'] = 4;
m['j'] = 5;
m['k'] = 5;
m['l'] = 5;
m['m'] = 6;
m['n'] = 6;
m['o'] = 6;
m['p'] = 7;
m['q'] = 7;
m['r'] = 7;
m['s'] = 7;
m['t'] = 8;
m['u'] = 8;
m['v'] = 8;
m['w'] = 9;
m['x'] = 9;
m['y'] = 9;
m['z'] = 9;
map<string, int> M;
for(int i = 0; i < n; i++) {
cin >> s[i];
string t = "";
for(int j = 0; j < s[i].size(); j++) {
t += (char)m[s[i][j]] + '0';
}
sort(t.begin(), t.end());
M[t]++;
}
string t1;
cin >> t1;
sort(t1.begin(), t1.end());
cout << M[t1] << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |