#include #include #include #include using namespace std; int main() { string s; cin >> s; vector tree(3); for(int i = 0;i < s.length();i++){ if(s[i] == 't')tree[0]++; else if(s[i] == 'r')tree[1]++; else if(s[i] == 'e')tree[2]++; } tree[2]/=2; sort(tree.begin(),tree.end()); cout << tree[0] << endl; return 0; }