#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;


int main()
{
	int N;
	cin >> N;

	string name;
	cin >> name;

	int count = 0;
	
	for(int times = 0; times < N; times++) {
		string origin;
		cin >> origin;

		vector<string> cans;
		for(int span = 1; span < origin.size(); span++) {
			for(int head = 0; head < origin.size(); head++) {
				string res;
				
				for(int i = 0; i < name.size() && head + span * i < origin.size(); i++) {
					res += origin[head + span * i];
				}

				cans.push_back(res);
			}
		}

		count += find(cans.begin(), cans.end(), name) != cans.end();
	}

	cout << count << endl;
}