if __name__ == '__main__': S = input(">>") num = 0 t = 0 r = 0 e = 0 for str1 in S: if(str1 == "t"): t += 1 elif(str1 == "r"): r += 1 elif(str1 == "e"): e += 1 e /= 2 e = int(e) while(e != 0): if(t > 0): t -= 1 if(r > 0): r -= 1 if(e > 0): e -= 1 num += 1; print(num)