#include<iostream>
#include<string>

int main(){

	int n;
	std::cin >> n;

	std::string str;
	std::cin >> str;

	int res = 0;

	for (int i = 0; i < n; i++){
		std::string sign;
		std::cin >> sign;

		for (int j = 0; j < sign.size(); j++){
			if (sign[j] == str[0]){
				for (int k= j + 1; k < sign.size(); k++){
					if (sign[k] == str[1]){
						int aida = k - j;
						bool flg = true;
						for (int l = 1; l <= str.size() - 2; l++){
							if (k + aida*l >= sign.size() || sign[k + aida*l] != str[l + 1])flg = false;
						}

						if (flg){
							res++;
							goto next;
						}
					}
				}
			}
		}

	next:;
	}

	std::cout << res << std::endl;

	return 0;
}