#include<bits//stdc++.h>
using namespace std;
#define INF 1e8
bool check(char a, char b)
{
if(a==b)
return 1;
if(a=='a'&&b=='o')
return 1;
if(a=='o'&&b=='a')
return 1;
if(a=='t'&&b=='l')
return 1;
if(a=='l'&&b=='t')
return 1;
return 0;
}
int main()
{
int n;
cin>>n;
string draw_string;
cin>>draw_string;
string ticket[n];
for(int i=0;i<n;i++)
{
cin>>ticket[i];
}
int k;
cin>>k;
int ans=0;
for(int i=0;i<n;i++)
{
int dp[201][201][2][2];
int sz2=draw_string.size(),sz1=ticket[i].size();
for(int j=0;j<sz1;j++)
{
dp[j][sz2][0][0]=INF;
dp[j][sz2][1][0]=INF;
dp[j][sz2][0][1]=INF;
dp[j][sz2][1][1]=INF;
}
dp[sz1-1][sz2][0][1]=0;
dp[sz1-1][sz2][1][1]=0;
for(int j=0;j<=sz2;j++)
{
dp[sz1][j][0][0]=0;
dp[sz1][j][1][0]=0;
dp[sz1][j][0][1]=0;
dp[sz1][j][1][1]=0;
}
for(int j=sz1-1;j>=0;j--)
{
for(int k=sz2-1;k>=0;k--)
{
if(check(ticket[i][j],draw_string[k]))
{
dp[j][k][0][0]=min(dp[j+1][k+1][1][0],dp[j][k+1][0][0]);
dp[j][k][1][0]=dp[j+1][k+1][1][0];
}
else
{
dp[j][k][0][0]=dp[j][k+1][0][0];
dp[j][k][1][0]=1+dp[j][k+1][1][0];
}
if(check(ticket[i][j],draw_string[k]))
{
dp[j][k][0][1]=min(dp[j+1][k+1][1][1],dp[j][k+1][0][1]);
dp[j][k][1][1]=dp[j+1][k+1][1][1];
}
else
{
dp[j][k][0][1]=min(dp[j][k+1][0][1],dp[j+1][k+1][0][0]);
dp[j][k][1][1]=min(1+dp[j][k+1][1][1],dp[j+1][k+1][1][0]);
}
}
}
if(dp[0][0][0][1]<=k)
ans++;
}
cout<<ans<<endl;
return 0;
}
I2luY2x1ZGU8Yml0cy8vc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgSU5GIDFlOApib29sIGNoZWNrKGNoYXIgYSwgY2hhciBiKQp7CiAgICBpZihhPT1iKQogICAgICAgIHJldHVybiAxOwogICAgaWYoYT09J2EnJiZiPT0nbycpCiAgICAgICAgcmV0dXJuIDE7CiAgICBpZihhPT0nbycmJmI9PSdhJykKICAgICAgICByZXR1cm4gMTsKICAgIGlmKGE9PSd0JyYmYj09J2wnKQogICAgICAgIHJldHVybiAxOwogICAgaWYoYT09J2wnJiZiPT0ndCcpCiAgICAgICAgcmV0dXJuIDE7CiAgIHJldHVybiAwOwp9CgppbnQgbWFpbigpCnsgICAgCiAgIGludCBuOwogICBjaW4+Pm47CiAgIHN0cmluZyBkcmF3X3N0cmluZzsKICAgY2luPj5kcmF3X3N0cmluZzsKICAgc3RyaW5nIHRpY2tldFtuXTsKICAgZm9yKGludCBpPTA7aTxuO2krKykKICAgewogICAgICBjaW4+PnRpY2tldFtpXTsKICAgfQogICBpbnQgazsKICAgY2luPj5rOwogICBpbnQgYW5zPTA7CiAgIGZvcihpbnQgaT0wO2k8bjtpKyspCiAgIHsgIAogICAgICBpbnQgZHBbMjAxXVsyMDFdWzJdWzJdOwogICAgICBpbnQgc3oyPWRyYXdfc3RyaW5nLnNpemUoKSxzejE9dGlja2V0W2ldLnNpemUoKTsKICAgICAgZm9yKGludCBqPTA7ajxzejE7aisrKQogICAgICB7CiAgICAgICAgZHBbal1bc3oyXVswXVswXT1JTkY7CiAgICAgICAgZHBbal1bc3oyXVsxXVswXT1JTkY7CiAgICAgICAgZHBbal1bc3oyXVswXVsxXT1JTkY7CiAgICAgICAgZHBbal1bc3oyXVsxXVsxXT1JTkY7CiAgICAgIH0KICAgICAgZHBbc3oxLTFdW3N6Ml1bMF1bMV09MDsKICAgICAgZHBbc3oxLTFdW3N6Ml1bMV1bMV09MDsKICAgICAgZm9yKGludCBqPTA7ajw9c3oyO2orKykKICAgICAgewogICAgICAgIGRwW3N6MV1bal1bMF1bMF09MDsKICAgICAgICBkcFtzejFdW2pdWzFdWzBdPTA7CiAgICAgICAgZHBbc3oxXVtqXVswXVsxXT0wOwogICAgICAgIGRwW3N6MV1bal1bMV1bMV09MDsKICAgICAgfQogICAgICBmb3IoaW50IGo9c3oxLTE7aj49MDtqLS0pCiAgICAgIHsKICAgICAgICBmb3IoaW50IGs9c3oyLTE7az49MDtrLS0pCiAgICAgICAgeyAgCiAgICAgICAgICAgaWYoY2hlY2sodGlja2V0W2ldW2pdLGRyYXdfc3RyaW5nW2tdKSkKICAgICAgICAgICB7CiAgICAgICAgICAgICBkcFtqXVtrXVswXVswXT1taW4oZHBbaisxXVtrKzFdWzFdWzBdLGRwW2pdW2srMV1bMF1bMF0pOwogICAgICAgICAgICAgZHBbal1ba11bMV1bMF09ZHBbaisxXVtrKzFdWzFdWzBdOwogICAgICAgICAgIH0KICAgICAgICAgICBlbHNlCiAgICAgICAgICAgewogICAgICAgICAgICAgIGRwW2pdW2tdWzBdWzBdPWRwW2pdW2srMV1bMF1bMF07CiAgICAgICAgICAgICAgZHBbal1ba11bMV1bMF09MStkcFtqXVtrKzFdWzFdWzBdOwogICAgICAgICAgIH0KICAgICAgICAgICBpZihjaGVjayh0aWNrZXRbaV1bal0sZHJhd19zdHJpbmdba10pKQogICAgICAgICAgIHsKICAgICAgICAgICAgIGRwW2pdW2tdWzBdWzFdPW1pbihkcFtqKzFdW2srMV1bMV1bMV0sZHBbal1baysxXVswXVsxXSk7CiAgICAgICAgICAgICBkcFtqXVtrXVsxXVsxXT1kcFtqKzFdW2srMV1bMV1bMV07CiAgICAgICAgICAgfQogICAgICAgICAgIGVsc2UKICAgICAgICAgICB7CiAgICAgICAgICAgICAgZHBbal1ba11bMF1bMV09bWluKGRwW2pdW2srMV1bMF1bMV0sZHBbaisxXVtrKzFdWzBdWzBdKTsKICAgICAgICAgICAgICBkcFtqXVtrXVsxXVsxXT1taW4oMStkcFtqXVtrKzFdWzFdWzFdLGRwW2orMV1baysxXVsxXVswXSk7CiAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgfQogICAgICBpZihkcFswXVswXVswXVsxXTw9aykKICAgICAgICBhbnMrKzsKICAgIH0KICAgY291dDw8YW5zPDxlbmRsOwogICAgcmV0dXJuIDA7Cn0=