#include #include using namespace std; using ll = long long; string S; int main(void){ ios::sync_with_stdio(false); cin.tie(nullptr); cin >> S; ll cntt = 0, cntr = 0, cnte = 0; for(char c : S){ if(c == 't')cntt++; if(c == 'r')cntr++; if(c == 'e')cnte++; } cout << min({cntt, cntr, cnte / 2}) << endl; return 0; }