Politics

#include using namespace std;int main() { string S; cin >> S; int sum = 0; long long answer = 0; for (int i = 0; i < S.size(); i++) { if (S[i] == 'W') { answer += (i – sum); sum++; } } cout << answer << endl; return 0;}