package main import ( "bufio" "fmt" "os" "strconv" ) import "strings" func main() { var sc = bufio.NewScanner(os.Stdin) var os, ns,t string var n int var c int var err error var ts string if sc.Scan() { os = sc.Text() } if sc.Scan() { ts = sc.Text() n ,err = strconv.Atoi(ts) if err != nil { fmt.Print("error") } } c = 0 var i int for i = 0; i < n; i++ { ns = os if sc.Scan() { t = sc.Text() var pos int pos = strings.Index(ns,t ) ns = ns[pos+1:len(ns)] for ; pos != -1 ; { c += 1 pos = strings.Index(ns,t ) ns = ns[pos+1:len(ns)] } } } fmt.Println(c) }