s = input() from collections import defaultdict d = defaultdict(int) for si in s: if si=="t" or si=="r"or si=="e": d[si]+=1 d = dict(d) d['e']=int(d['e']/2) print(min(list(d.values())))