#include <bits/stdc++.h>
using namespace std;
const int Max = 1e5 + 10;
const int Alph = 26;
int f[Max];
void KMP(string s, string t, int* res) {
  int n = s.size(), m = t.size();
  for (int i = 1; i < m; i++) {
    int state = f[i];
    while (state && t[state] != t[i]) state = f[state];
    if (t[state] == t[i]) state++;
    f[i + 1] = state;
  }
  int state = 0;
  for (int i = 0; i < n; i++) {
    while (state && t[state] != s[i]) state = f[state];
    if (t[state] == s[i]) state++;
    res[i + 1] = max(res[i], state);
    if (state == m) state = f[state];
  }
}
int res[Max];
int revRes[Max];
int main() {
  string S;
  cin >> S;
  string RS = S;
  reverse(RS.begin(), RS.end());
  int N;
  cin >> N;
  int cnt = 0;
  while (N--) {
    string T;
    cin >> T;
    string RT = T;
    reverse(RT.begin(), RT.end());
    if (T.size() == 1) continue;
    KMP(S, T, res);
    KMP(RS, RT, revRes);
    for (int i = 1; i <= S.size(); i++) {
      if (res[i] + revRes[S.size() - i] >= (int)T.size()) {
        cnt++;
        break;
      }
    }
  }
  cout << '\n';
  cout << cnt << '\n';
}
