#include <iostream>
#include <string>

using namespace std;

int main(){
	int n;
	string name;
	string board;
	int count = 0;
	cin >> n >> name;

	for (int i = 0; i < n; i++){
		cin >> board;
		bool x = 0;
		for (int j = 0; j < board.size() && !x ; j++){
			if (name[0] == board[j]){
				for (int k = j + 1; k < board.size() && !x; k++){
					if (board[k] == name[1]){
						for (int l = 0, m = j; !x && m < board.size(); l++, m += k - j){
							if (name[l] != board[m]) break;
							if (l == name.size() - 1) x = 1;
						}
					}
				}
				if (x) count++;
			}
		}
	}
	
	cout << count << endl;

	return 0;
}