#include using namespace std; int main() { map m; char c; while (~scanf("%c", &c)) { m[c]++; } cout << min(m['t'], min(m['r'], m['e'] / 2)) << endl; }