
object Main extends App {

  import scala.io.StdIn._

  val n = readLine.trim.toInt
  val name = readLine.trim
  val kanban = Array.tabulate(n){_ ⇒ readLine.trim}

  println((for (k ← kanban) yield {
    (for (i ← 1 to (k.length - 1) / (name.length - 1)) yield {
      (for (j ← 0 until k.length - i * (name.length - 1)) yield {
        name.zipWithIndex.forall{case (c, idx) ⇒ k(i * idx + j) == c}
      }).exists(f ⇒ f)
    }).exists(f ⇒ f)
  }).count(f ⇒ f))
  implicit class ScopeFunc[T](val value: T) {
    def let[A](func: T ⇒ A): A = func(value)

    def also(func: T ⇒ Unit): T = {
      func(value)
      value
    }
  }
}

/*
 */
