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