import math M = input() t = M.count('t') r = M.count('r') e = math.floor(M.count('e') / 2) array = [t, r, e] array.sort() print(array[0])