#include #include #include #include #include #include #include #include #include #define rep(i,l,n) for(lint i=l;i vi; typedef vector vli; typedef vector vvi; typedef pair pii; int main(){ string s; cin>>s; vi d(s.size()); rep(i,0,s.size()){ if(s[i]=='w') d[i]++; } for(int i=s.size()-2;i>=0;i--){ d[i]+=d[i+1]; } lint ans=0; rep(i,0,s.size()){ if(s[i]=='c'){ lint tmp=0; tmp=d[i]*(d[i]-1)/2; ans+=tmp; } } o(ans); }