#include <bits/stdc++.h>
typedef long long LL;
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

using namespace std;
int main(void)
{
  int n;
  cin >> n;
  string nsign;
  cin >> nsign;
  int answer=0;
  REP(i,n){
    string osign;
    cin >> osign;
    bool flag=false;
    REP(beg,osign.size()){
      FOR(gap,1,osign.size()){
	if(osign.size()<=beg+(nsign.size()-1)*gap) break;
	bool tmpflag=true;
	REP(j,nsign.size())
	  if(osign[beg+gap*j] != nsign[j]) tmpflag=false;
	flag=flag||tmpflag;
      }
    }
    if(flag) ++answer;
  }
  cout << answer << endl;
  return 0;  
}