import scala.io.StdIn object Problem279 { def main(args: Array[String]) { val s = StdIn.readLine() val result = Seq(s.count(_ == 't'), s.count(_ == 'r'), s.count(_ == 'e') / 2).min println(result) } }