#include<iostream>
#include<vector>
#include<string>

using namespace std;

int main(){
	int n,cnt = 0;
	string name;

	cin >> n;
	cin >> name;

	vector<string> str;
	str.resize(n);

	for(int i=0;i<n;i++){
		cin >> str[i];
	}

	int name_len = name.length();

	for(int i=0;i<n;i++){
		int len = str[i].length();
		if(str[i] == name){
			cnt++;
			goto ok;
		}
		for(int j=0;j<len;j++){
			if(str[i][j] == name[0]){
				for(int k=j,sp=0;k<len;k++,sp++){
					if(str[i][k] == name[1]){
						bool flag = true;
						for(int l=2,c=1;l<name_len;c++,l++){
							if(str[i][k+sp*c] != name[l]){
								flag = false;
							}
						}
						if(flag){
							cnt++;
							goto ok;
						}
					}
				}
			}
		}
		ok:;
	}

	cout << cnt << endl;
	return 0;
}