#include <cstdio>
#include <stdio.h>
#include <stdbool.h>
#include <iostream>
#include <map>
#include <vector>
#include <climits>
#include <stack>
#include <string>
#include <queue>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
#include <cctype>
#include <bitset>
#include <iomanip>
#include <cstring>
#include <numeric>
#include <cassert>
#include <random>
#include <chrono>
#include <fstream>
using namespace std;
#define int long long
#define pii pair<int, int>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
int32_t main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, ans=0;
cin>>n;
string s;
vector<string> vect(n);
for (int i=0; i<n; ++i)cin>>vect[i];
cin>>s;
map<char, char> m;
m['a']=m['b']=m['c']='2';
m['d']=m['e']=m['f']='3';
m['g']=m['h']=m['i']='4';
m['j']=m['k']=m['l']='5';
m['m']=m['n']=m['o']='6';
m['p']=m['q']=m['r']=m['s']='7';
m['t']=m['u']=m['v']='8';
m['w']=m['x']=m['y']=m['z']='9';
for (int i=0; i<n; ++i){
bool can=1;
for (int j=0; j<vect[i].size(); ++j)if (s[j]!=m[vect[i][j]])can=0;
ans+=can;
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |