S=raw_input() dp=[[0]*len(S) for _ in xrange(4)] if S[0]=="c": dp[1][0]=1 dp[0][0]=1 for i in xrange(1,len(S)): dp[0][i] = dp[0][i-1] if S[i]=="c": dp[1][i] = dp[0][i-1]+dp[1][i-1] dp[2][i] = dp[2][i-1] dp[3][i] = dp[3][i-1] elif S[i]=="w": dp[1][i] = dp[1][i-1] dp[2][i] = dp[1][i-1]+dp[2][i-1] dp[3][i] = dp[2][i-1]+dp[3][i-1] else: dp[1][i] = dp[1][i-1] dp[2][i] = dp[2][i-1] dp[3][i] = dp[3][i-1] print dp[3][len(S)-1]