#include int main() { char str[1000001]; char flg[26]; int ans = 0; for (int i = 0; i < 26; i++) flg[i] = 0; scanf("%s", str); for (int i = 0; str[i] != '\0'; i++) flg[str[i] - 'a']++; if (flg['t' - 'a'] > flg['r' - 'a']) { ans = flg['r' - 'a']; } else { ans = flg['t' - 'a']; } if (flg['e' - 'a'] / 2 > flg['r' - 'a']) { ans = flg['r' - 'a']; } else { ans = flg['e' - 'a'] / 2; } printf("%d", ans); return 0; }