#include<iostream>
#include<cstring>
#include<string>
using namespace std;

int main(){
  int n,cou=0,count=0,time;
  int len,oldlen;
  char com[33],tmp[33];
  char old[111];
  string strtmp,strcom;
  cin >> n;
  cin >> com;
  strcom = com;
  len = strlen(com);
  while(cou!=n){
    cou++;
    cin >> old;
    oldlen = strlen(old);
    for(int i=0;i<oldlen;i++){
      time = 1;
      if(com[0] == old[i]){
	while(i+time*(len-1) < oldlen){
	  strtmp = old[i];
	  for(int j=1;j<len;j++){
	    strtmp += old[i+time*j];
	  }
	  if(strcom == strtmp){
	    count++;
	    i = oldlen;
	  }
	  else time++;
	}
      }
    }
  }
  cout << count << endl;
}