#include #include #include #include #include using namespace std; int main(void) { std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout << std::fixed; map cnt; char c; while (cin >> c) cnt[c]++; cout << min(min(cnt['t'], cnt['r']), cnt['e'] / 2) << endl; }