using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace template { class Program { static void Main(string[] args) { string s = Console.ReadLine(); int[] ret = new int[3]; for (int i = 0; i < s.Length; i++) { switch (s[i]) { case ('t'): { ret[0]++; break; } case ('r'): { ret[1]++; break; } case ('e'): { ret[2]++; break; } } } ret[2] /= 2; Console.WriteLine(ret.Min()); } } }