n = gets.chomp.to_i
k = gets.chomp
a = []
n.times do |i|
	a[i] = gets.chomp
end
ans=0
a.each do |e|
	catch(:br) do
		msp = (e.size - k.size) / (k.size - 1)
		for sp in 0..msp
			for st in 0..(sp+1)
				str = []
				st.step(e.size-1, sp+1) do |i|
					str.push(e[i])
				end
				if str.join.include?(k)
					ans += 1
					throw :br
				end
			end
		end
	end
end
puts ans