#include <bits/stdc++.h>
using namespace std;
long long f[1000005] = {}, b[1000005] = {};
string s;
int main() {
  long long i, j, cntf = 0, cntb = 0, n, ans = 0, m;
  cin >> s;
  n = s.size();
  for (i = 1; i <= n; i++) {
    if (s[i - 1] == 'o') {
      f[i] = f[i - 1] + max(cntf - 1, (long long)0);
      cntf = 0;
    } else {
      f[i] = f[i - 1];
      cntf++;
    }
    j = n - i + 1;
    if (s[j - 1] == 'o') {
      b[j] = b[j + 1] + max(cntb - 1, (long long)0);
      cntb = 0;
    } else {
      b[j] = b[j + 1];
      cntb++;
    }
  }
  for (i = 1; i <= n; i++) {
    if (s[i - 1] == 'o') ans += f[i] * b[i];
  }
  cout << ans << endl;
  return 0;
}
