#include using namespace std; int main(){ string S; cin >> S; int N = S.size(); int t = 0; int r = 0; int e = 0; for (int i = 0; i < N; i++){ if (S[i] == 't'){ t++; } if (S[i] == 'r'){ r++; } if (S[i] == 'e'){ e++; } } cout << min({t, r, e / 2}) << endl; }