s=[0]*26 for c in input():s[ord(c)-97]+=1 m=min t=m(s[8],s[10]) print(m(s[24],s[20],s[0],s[17],t),m(s[0]//2,s[17],t),m(s[24],s[20]//3,s[25]//2,t))