#include <bits/stdc++.h>
char s[1000005];
int a[1000005];
int main(int argc, char* argv[]) {
  int i, m, len, sum = 0;
  long long ans = 0;
  gets(s);
  len = strlen(s);
  for (i = m = 0; i < len; i++) {
    if (s[i] == 'o')
      m++;
    else
      a[m]++;
  }
  m++;
  for (i = 0; i < m; i++)
    if (a[i]) {
      a[i]--;
      sum += a[i];
    }
  long long x = 0;
  long long y = sum;
  for (i = 0; i < m; i++) {
    x += a[i];
    y -= a[i];
    ans += x * y;
  }
  printf("%I64d\n", ans);
  return 0;
}
