#include using namespace std; //-------------------------------------------- #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) RFOR(i,0,n) #define LL long long #define INF INT_MAX/3 //-------------------------------------------- const double EPS = 1e-14; const double PI = acos(-1.0); //-------------------------------------------- int main(){ int t = 0; int r = 0; int e = 0; string s; cin >> s; REP (i,s.size()) { if (s[i] == 't') t++; if (s[i] == 'r') r++; if (s[i] == 'e') e++; } printf("%d\n",min(t,min(r,e / 2))); }