#include <iostream>
#include <algorithm>
#include <string>
#define int long long
using namespace std;
signed main() {
	int n, ans = 0; string st;
	cin >> n >> st;
	int m = st.size();
	for (int i = 0; i < n; i++) {
		string s; cin >> s;
		int t = s.size();
		for (int i = 0; i <= t - m; i++) {
			if (s[i] == st[0]) {
				for (int j = i + 1; (j - i)*(m - 1) + i < t; j++) {
					if (s[j] == st[1]) {
						for (int p = 2; p < m; p++) {
							if (s[(j - i)*p + i] != st[p])goto heaven;
						}
						ans++;
						goto hell;
					}
					heaven:;
				}
			}
		}
		hell:;
	}
	cout << ans << endl;
}
