str = gets e = str.count('e') t = str.count('t') r = str.count('r') puts [e/2, t, r].min