#include #include int main(){ char str[10000000]; scanf("%s",str); int templates[3] = {0,0,0}; int len = strlen(str); for(int i = 0;i < len;i ++){ if(str[i] == 't'){ templates[0]++; }else if(str[i] == 'r'){ templates[1]++; }else if(str[i] == 'e'){ templates[2]++; } } templates[2] /= 2; for(int i = 0;i < 3;i ++){ for(int j = 0;j < 3;j ++){ if(templates[i] > templates[j]){ int tmp = templates[i]; templates[i] = templates[j]; templates[j] = tmp; } } } printf("%d",templates[0]); }