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