s=input() c=0 for i in range(s.count('S')): s=s[s.find('S')+1:] c+=s.count("ing") print(c)