#include <bits/stdc++.h>

using namespace std;

string a[100];

int main()
{
	int n; cin >> n;
	string S; cin >> S;

	int ans = 0;

	for (int i = 0; i < n; ++i) {
		string s; cin >> s;
		int len = s.length();
		for (int j = 1; j < len; ++j) {
			for (int k = 0; k < len; ++k) {
				int cnt = 0;
				int idx = 0;
				int now;
				for (now = k; now < len; now += j) {
					if (s[now] == S[idx]) {
						idx++;
						cnt++;
					} else {
						idx = cnt = 0;
						break;
					}

					if (cnt == S.length()) {
						ans++;
						goto next;
					}
				}
			}
		}
next:;
	}

	printf("%d\n", ans);
}