#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
char str[26];
char b[100][101];
int main(void)
{
	int a;
	scanf("%d", &a);
	scanf("%s", str);
	int n = strlen(str);
	for (int i = 0; i < a; i++)scanf("%s", b[i]);
	int ret = 0;
	for (int i = 0; i < a; i++)
	{
		bool on = false;
		int m = strlen(b[i]);
		for (int j = 0; j < m; j++)
		{
			for (int k = 1; j + k*(n - 1) < m; k++)
			{
				int at = j;
				bool ok = true;
				for (int l = 0; l < n; l++)
				{
					if (str[l] != b[i][at]) ok = false;
					at=at+k;
				}
				if (ok)on = true;
			}
		}
		if (on)ret++;
	}
	printf("%d\n", ret);
	return 0;
}