#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef pair pii; typedef vector vi; #define rep(i,x) for(int i=0;i<(int)(x);++i) int main(){ int ret, t = 0, r = 0, e = 0; string str; cin >> str; rep(i, str.size()) { if (str[i] == 't') ++t; else if (str[i] == 'r') ++r; else if (str[i] == 'e') ++e; } ret = (t >= r) ? r : t; ret = (ret >= e/2) ? e/2 : ret; cout << ret << endl; return 0; }