h=Hash.new(0) gets.chars.each{|c|h[c]+=1} puts [h['t'],h['r'],h['e']/2].min