package main import ( "bufio" "fmt" "os" "strings" ) func main() { S := readString() T := readString() result := 0 p := 0 for { p = strings.Index(S[p:], T) if p == -1 { break } p = p + len(T) - 1 result++ } fmt.Println(result) } const ( ioBufferSize = 1 * 1024 * 1024 // 1 MB ) var stdinScanner = func() *bufio.Scanner { result := bufio.NewScanner(os.Stdin) result.Buffer(make([]byte, ioBufferSize), ioBufferSize) result.Split(bufio.ScanWords) return result }() func readString() string { stdinScanner.Scan() return stdinScanner.Text() }