#include<bits//stdc++.h>
using namespace std;
#define INF 1e8
/*
Time Complexity: O(M^2*(N))
Space Complexity: O(1)
Where N and M are the total lengths of all tickets and the length of the match string.
*/
// Helper Function to match the characters according to the given conditions
bool matchChar(char char1, char char2)
{
if(char1 == char2)
{
return true;
}
if((char1 == 'a' && char2 == 'o') || (char1 == 'o' && char2 == 'a'))
{
return true;
}
if((char1 == 't' && char2 == 'l') || (char1 == 'l' && char2 == 't'))
{
return true;
}
return false;
}
// Check if the subtring matches with the ticket with at most K characters skipped
bool match(string &matchStr, string &ticket, int k)
{
// If the ticket is less then the string return False
if(matchStr.size() < ticket.size())
return false;
int i = 0;
int j = 0;
while(i < matchStr.size() && j < ticket.size())
{
if(matchChar(matchStr[i], ticket[j]))
j += 1;
i += 1;
}
// If all the characters of the ticket are not found return False
if(j != ticket.size())
return false;
// If the substring length is greater by more than K characters return False
return i - j <= k ? true : false;
}
int lotteryTickets(string &matchStr, vector<string> &tickets, int k)
{
int count = 0;
// Iterate for each ticket
for(int z = 0; z < tickets.size(); z++)
{
string ticket = tickets[z];
bool found = false;
// Iterate over every substring of the string
for(int i = 0; i < matchStr.size(); i++)
{
string curr;
for(int j = i; j < matchStr.size(); j++)
{
curr += matchStr[j];
if(match(curr, ticket, k))
{
found = true;
count += 1;
break;
}
}
if(found)
{
break;
}
}
}
// Return the number of matched tickets
return count;
}
int main()
{
int n;
cin>>n;
string draw_string;
cin>>draw_string;
vector<string> ticket(n);
for(int i=0;i<n;i++)
{
cin>>ticket[i];
}
int k;
cin>>k;
int ans=lotteryTickets(draw_string,ticket,k);
cout<<ans<<endl;
return 0;
}