#include using namespace std; typedef unsigned long long ul; typedef signed long long ll; ul over = 1000000007; int main(void) { cin.tie(0); ios::sync_with_stdio(false); cout << fixed; string s; cin >> s; ll t=0, r=0, e=0; for (auto c : s) { if (c=='t') t++; if (c=='r') r++; if (c=='e') e++; } cout << min(t, min(r, e/2)) << endl; return 0; }