#include <iostream>
#include <string>

using namespace std;

int main(){

	int n , c = 0 , ans = 0;
	int count = 0 , cou = 0;
	string name , prob , newname;
	cin >> n;
	cin >> name;

	for(int i = 0; i < n; i++){
		cin >> prob;
		int flag = 0;
		for(int e = 0; e < prob.size(); e++){
			c = 0;
			
			for(int j = 0; j < prob.size(); j++){
				if(flag == 1) break;
					c++;
					newname = "";
					count = e;
				for(int k = 0; k < prob.size(); k++){
					newname += prob[count];
					count += c;
					if(newname.size() == name.size() || prob.size() < count){
						if(newname == name){
							ans++;
							flag = 1;
						}
						break;
					}
				}
			}
		}
	}
	cout << ans << endl;

	return 0;
}