#coding=UTF-8 #並び換えが出来るのなら楽なはず S=input() hindo={'t':0,'r':0,'e':0} for moji in S: hindo[moji]= (hindo[moji] if moji in hindo else 0)+1 print(min(hindo['t'],hindo['r'],hindo['e']//2))#eは2個必要なことに注意