package me.yukicoder; import java.util.Scanner; /** * http://yukicoder.me/problems/531 * star1 */ public class YukiCoder279 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); int t = 0, r = 0, e = 0; StringBuilder sb = new StringBuilder(); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c == 't') { t++; } else if (c == 'r') { r++; } else if (c == 'e') { e++; } } int num = Math.min(Math.min(t, r), e / 2); System.out.println(num); } } /* takahashikunlovesyukicoder 1 treapisnotki 0 eerteerteerteert 4 */