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