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

int main() {
	int n;
	cin >> n;
	string ans;
	cin >> ans;
	int count = 0;
	int len = ans.size();
	while (n--) {
		bool flag = false;
		string s;
		cin >> s;
		for (int j = 1; j < 50; j++) {
			for (int i = 0; i < 100; i++) {
				bool match = true;
				int cnt = 0;
				for (int k = i; cnt < len; k += j) {
					if (k >= s.size()) break;
					if (s[k] != ans[cnt]) {
						match = false;
						break;
					}
					cnt++;
				}
				if (match && cnt == len) {
					flag = true;
				}
			}
		}
		if (flag) {
			count++;
		}
	}
	cout << count << endl;
	return 0;
}