#include <iostream>
#include <string>

using namespace std;

int main() {
  int n, source_len, sign_len, count = 0, suffix;
  string source, sign;

  cin >> n >> source;
  source_len = source.length();

  bool success;
  for (int i = 0; i < n; i++) {
	cin >> sign;
	sign_len = sign.length();
	success = false;
	for (int j = 0; j < sign_len; j++) { //先頭文字のループ
	  for (int k = 0; k <= sign_len / 2; k++) { //間隔のループ
		for (int l = 0, suffix = j; l < source_len; l++) { //文字のループ
		  if (source[l] != sign[suffix]) {
			break;
		  }
		  if (l == source_len - 1) {
			success = true;
			count++;
			break;
		  }
		  if ((suffix += k + 1) >= sign_len) break;
		}
		if (success) break;
	  }
	  if (success) break;
	}
  }

  cout << count << endl;

  return 0;
}