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