s=gets.chomp.chars; t={} for ch in s t[ch]=(t[ch] || 0) + 1 end puts [t['t']||0, t['r']||0, (t['e']||0)/2].min