S = input() C = ["t", "r", "e"] L = [] for c in C: L.append(S.count(c)) L[2] = L[2] // 2 print(min(L))