#! ruby # yukicoder My Practice # author: Leonardone @ NEETSDKASU S = gets.chomp m = Hash.new 0 S.each_char do |c| m[c] += 1 end puts [m['t'], m['r'], m['e'].div(2)].min