#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  vector<pair<long long int, long long int> > count;
  long long int c = 1;
  for (long long int i = 1; i < s.size(); i++) {
    if (s[i] == s[i - 1]) {
      c++;
    } else {
      long long int ch = s[i - 1] == 'o' ? 0 : 1;
      count.push_back({c, ch});
      c = 1;
    }
  }
  long long int ch = s[s.size() - 1] == 'o' ? 0 : 1;
  count.push_back({c, ch});
  vector<long long int> sum(count.size(), 0);
  for (long long int i = 0; i < count.size(); i++) {
    if (count[i].second == 1 && count[i].first == 1) {
      count[i].first = 0;
      if (i)
        sum[i] = sum[i - 1];
      else
        sum[i] = 0;
      continue;
    }
    if (count[i].second == 0) {
      if (i != 0)
        sum[i] = sum[i - 1];
      else
        sum[i] = 0;
    }
    if (count[i].second == 1) {
      count[i].first = count[i].first - 1;
      if (i)
        sum[i] = sum[i - 1] + count[i].first;
      else
        sum[i] = count[i].first;
    }
  }
  vector<long long int> revsum(count.size(), 0);
  for (long long int i = count.size() - 1; i >= 0; i--) {
    if (count[i].second == 1 && count[i].first == 0) {
      if (i != count.size() - 1)
        revsum[i] = revsum[i + 1];
      else
        revsum[i] = 0;
      continue;
    }
    if (count[i].second == 0) {
      if (i != count.size() - 1)
        revsum[i] = revsum[i + 1];
      else
        sum[i] = 0;
    }
    if (count[i].second == 1) {
      if (i != count.size() - 1)
        revsum[i] = revsum[i + 1] + count[i].first;
      else
        revsum[i] = count[i].first;
    }
  }
  long long int sol = 0;
  for (long long int i = 0; i < count.size(); i++) {
    if (count[i].second == 0) {
      sol += sum[i] * revsum[i] * count[i].first;
    }
  }
  cout << sol;
  return 0;
}
