# your code goes here str=STDIN.gets t=0 r=0 e=0 str.size.times do |i| c=str[i] case c when 't' t+=1 when 'r' r+=1 when 'e' e+=1 else end end as=[t,r,e.to_i/2] puts as.min