#include using namespace std; typedef long long ll; int main() { string s; cin>>s; int n=s.size(); int W[n+1]{}; for (int i=n-1;i>=0;i--) { W[i]=W[i+1]+(s[i]=='w'); } ll ans=0; for (int i=0;i=2) { ans+=W[i]*(W[i]-1)/2; } } cout<