a=0 for i in input(): a += [1,-1][i in 'WS'] print(abs(a)**(1/2))