import sequtils,strutils var cnt : array['a'..'z', int] s = stdin.readline for c in s: cnt[c] += 1 echo min(@[cnt['t'], cnt['r'], cnt['e'] div 2])