#include using namespace std; int main(){ string s; long long w_cnt[100001]={}; unsigned long long sum = 0; cin >> s; for(int i=s.size()-1;i>=0;i--){ w_cnt[i]=w_cnt[i+1]; if(s[i]=='w') w_cnt[i]++; } for(int i=0;i=2){ sum += ((w_cnt[i]-1)*(w_cnt[i]))/2; } } cout << sum << endl; }