s=input();t='' for i in s: if i in 'tree': t+=i print(len(t)//4)