0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-18 04:32:00 +00:00
OI-codes/S2OJ/1536/1536.cpp

43 lines
661 B
C++

#include <iostream>
#include <string>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 20005;
int n, ans;
std::string s, t;
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> s >> n;
int s_len = s.size();
for (int i = 1; i <= n; i++) {
cin >> t;
int t_len = t.size();
if (s_len == t_len) {
bool flag = true;
for (int i = 0; i < t_len; i++) {
if (s[i] != '#') {
flag &= s[i] == t[i];
}
}
if (flag) ans++;
}
}
cout << ans << endl;
return 0;
}