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