#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <iterator>
using namespace std;

int main(){
	int n;
	int count=0;
	string name;
	cin >> n >> name;
	vector<string> signs(n);
	for(int i=0; i<n; ++i){
		cin >> signs[i];
		//cout << signs[i].size() << "\n";
	}
	int namelen=name.size();
	for(int i=0; i<n; ++i){
		int len=signs[i].size();
		string sign=signs[i];
		for(int start=0; start<len; ++start){
			for(int step=1; start+(namelen-1)*step<len; ++step){
				for(int j=0; j<namelen; ++j){
					if(sign[start+step*j]!=name[j]){
						goto fail;
					}
				}
				count++;
				//cout << sign << "\n";
				goto naxtk;
fail:;
			}
		}
naxtk:;
	}
	cout << count << "\n";
	return 0;
}