package main import ( "bufio" "os" "fmt" "strconv" "strings" ) func main() { S := nextLine() t := 0 r := 0 e := 0 for _, v := range S { switch v{ case 't': { t+=1 } case 'r': { r+=1 } case 'e': { e+=1 } } } PrintI(minA(t, r, e/2)) } var s = bufio.NewScanner(os.Stdin) func next() string { s.Split(bufio.ScanWords) s.Scan() return s.Text() } func nextLine() string { s.Split(bufio.ScanLines) s.Scan() return s.Text() } func nextInt() int { i, e := strconv.Atoi(next()) if e != nil { panic(e) } return i } func nextLong() int64 { i, e := strconv.ParseInt(next(), 10, 64) if e != nil { panic(e) } return i } func min(a int, b int) int { if a < b { return a } return b } func minA(arg ...int) int { var s = arg[0] for _, v := range arg { s = min(s, v) } return s } func PrintI(args ...int) { fmt.Println(strings.Join(mapToString(args), " ")) } func mapToString(arr []int) []string { ret := make([]string, len(arr)) for i := 0; i < len(arr); i++ { ret[i] = strconv.Itoa(arr[i]) } return ret }