(function(input) {
  function contain(search, str, step, offset) {
    var len = search.length;

    step++;
    for ( var i = 0; i < len; i++ ) {
      if ( search[i] !== str[offset+i*step] ) {
        return false;
      }
    }
    return true;
  }

  function find(seatch, str, j) {
    var len = search.length,
        str_len = str.length;

    for ( var k = 0; k + len * j < str_len; k++ ) {
      if ( contain(search, str, j, k) ) {
        return true;
      }
    }
    return false;
  }

  var inputs = input.replace(/\r/g, "").split("\n"),
      n = parseInt(inputs[0]),
      search = inputs[1],
      len = search.length,
      sum = 0;

  for ( var i = 2; i < n + 2; i++ ) {
    var str = inputs[i];
    var str_len = str.length;
    for ( var j = 0; len * j < str_len; j++ ) {
      if ( find(search, str, j) ) {
        sum++;
        break;
      }
    }
  }
  console.log(sum);

})(require("fs").readFileSync("/dev/stdin", "utf8"));