#include <bits/stdc++.h>
#define int long long
#define MASK(i) (1LL << (i))
using namespace std;
const int inf = 1e18;
const int N = 3e5 + 5;
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int mp[256];
    mp['a'] = mp['b'] = mp['c'] = 2;
    mp['d'] = mp['e'] = mp['f'] = 3;
    mp['g'] = mp['h'] = mp['i'] = 4;
    mp['j'] = mp['k'] = mp['l'] = 5;
    mp['m'] = mp['n'] = mp['o'] = 6;
    mp['p'] = mp['q'] = mp['r'] = mp['s'] = 7;
    mp['t'] = mp['u'] = mp['v'] = 8;
    mp['w'] = mp['x'] = mp['y'] = mp['z'] = 9;
    int n;
    cin >> n;
    map<string, int> cnt;
    for (int i = 0; i < n; i++)
    {
        string s;
        cin >> s;
        string t = "";
        for (char c : s) t += to_string(mp[c]);
        cnt[t]++;
    }
    string s;
    cin >> s;
    cout << cnt[s];
    return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |