#include<iostream>
#include<string>

using namespace std;

int main() {
	int n, ans = 0; bool f;
	string s, gs;
	cin >> n >> s;
	int len = (signed)s.length(), glen;
	for(int i=0; i<n; ++i) {
		cin >> gs; f = false;
		glen = (signed)gs.length();
		for(int j=0; j<=glen-len&&!f; ++j) {
			for(int k=1; k<=(glen-j-1)/(len-1)&&!f; ++k) {
				for(int l=0; l<len; ++l) {
					if(s[l]!=gs[j+l*k]) break;
					if(l==len-1) {
						ans++; f=true;
						break;
					}
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}