package main import "fmt" func main() { var S string fmt.Scan(&S) set := make(map[byte]int, 0) for i := 0; i < len(S); i++ { if S[i] == 't' || S[i] == 'r' || S[i] == 'e' { set[S[i]]++ } } fmt.Println(min(set['t'], min(set['r'], set['e']/2))) } func min(a, b int) int { if a < b { return a } return b }