#include #include #include #include #include #include #include #include #include #include #include #include #include #define endl '\n' #define ALL(a) (a).begin(),(a).end() #define SZ(a) int((a).size()) #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) for (int i=(n)-1;i>=0;i--) #define DEBUG(x) cout<<#x<<": "< P; typedef long long int LL; int co[3]; int main() { ios::sync_with_stdio(false); cin.tie(0); string s; cin>>s; REP(i,SZ(s)){ if(s[i]=='t'){ co[0]++; }else if(s[i]=='r'){ co[1]++; }else if(s[i]=='e'){ co[2]++; } } int ans=INT_MAX; REP(i,2) ans=min(ans,co[i]); ans=min(ans,co[2]/2); cout<