s = gets.chomp hs = Hash.new(0) s.split('').map { |c| hs[c] += 1 } puts [hs['t'], hs['r'], hs['e'] / 2].min