n = gets.to_i
name = gets.chomp
count = 0
n.times{
	str = gets.chomp
	(0..str.size-name.size).each{|i|
		next if str[i] != name[0]
		ok = false
		k = 1
		loop {
			break if i + k * (name.size-1) >= str.size
			if (1..name.size-1).all?{|j| str[i + k * j] == name[j]}
				ok = true
				break
			end	
			k += 1
		}
		if ok
			count += 1
			break
		end
	}
}
p count