#include <iostream>
#include <string>

using namespace std;

int main(){
	string p, c;
	int n, ans = 0;
	cin >> n;
	cin >> p;

	for(int i = 0;i < n;++i){
		cin >> c;
		int j, k, l, d;
		bool f = false;
		for(int j = 0;j < c.length();++j){
			for(int d = 0;d < (c.length() - j);++d){
				l = 0;
				for(int k = j;k < c.length() && l < p.length();k += (d + 1)){
					if(p[l] == c[k]){
						++l;
					}
					else {
						break;
					}
				}
				if(l == p.length()){
					f = true;
					break;
				}
			}
			if(f) {
				++ans;
//				cout << c << endl;
				break;
			}
		}
	}

	cout << ans << endl;
}