Recall that string $a$ is a subsequence of a string $b$ if $a$ can be obtained from $b$ by deletion of several (possibly zero or all) characters. For example, for the string $a$="wowwo", the following strings are subsequences: "wowwo", "wowo", "oo", "wow", "", and others, but the following are not subsequences: "owoo", "owwwo", "ooo".

The wow factor of a string is the number of its subsequences equal to the word "wow". Bob wants to write a string that has a large wow factor. However, the "w" key on his keyboard is broken, so he types two "v"s instead. 

Little did he realise that he may have introduced more "w"s than he thought. Consider for instance the string "ww". Bob would type it as "vvvv", but this string actually contains three occurrences of "w":   "vvvv"  "vvvv"  "vvvv" 

For example, the wow factor of the word "vvvovvv" equals to four because there are four wows:  "vvvovvv"  "vvvovvv"  "vvvovvv"  "vvvovvv" 

Note that the subsequence "vvvovvv" does not count towards the wow factor, as the "v"s have to be consecutive.

For a given string $s$, compute and output its wow factor. Note that it is not guaranteed that it is possible to get $s$ from another string replacing "w" with "vv". For example, $s$ can be equal to "vov".


-----Input-----

The input contains a single non-empty string $s$, consisting only of characters "v" and "o". The length of $s$ is at most $10^6$.


-----Output-----

Output a single integer, the wow factor of $s$.


-----Examples-----
Input
vvvovvv

Output
4

Input
vvovooovovvovoovoovvvvovovvvov

Output
100



-----Note-----

The first example is explained in the legend.

Difficulty: EASY
Tags: String algorithms

Dynamic programming
Skill types: Dynamic programming

Starter code:

Solutions:
import math
import sys
import collections

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def geto(s, i, j):
	res = 0
	for k in range(i + 1, j):
		if s[k] == 'o':
			res += 1
	return res

def count(a, b):
	m = len(a)
	n = len(b)
	lookup = [[0] * (n + 1) for i in range(m + 1)]
	for i in range(n + 1):
		lookup[0][i] = 0
	for i in range(m + 1):
		lookup[i][0] = 1
	for i in range(1, m + 1):
		for j in range(1, n + 1):
			if a[i - 1] == b[j - 1]:
				lookup[i][j] = lookup[i - 1][j - 1] + lookup[i - 1][j]
			else:
				lookup[i][j] = lookup[i - 1][j]
	return lookup[m][n]
s = input()
if len(s) < 5:
	print(0)
	exit()
n = len(s)
vpos = []
d = []
i = 0
mode = 'v'
while i < n - 1:
	if s[i] == s[i + 1] == 'v':
		vpos.append(i)
		t = 0
		while i < n and s[i] == mode:
			t += 1
			i += 1
		d.append(t - 1)
	i += 1
r = []
for i in range(len(d) - 1):
	r.append(d[i])
	r.append(geto(s, vpos[i], vpos[i + 1]))
r.append(d[-1])
news = []
mode = 'w'
for i in r:
	news.append(mode * i)
	mode = 'w' if mode == 'o' else 'o'
print(count(''.join(news), 'wow'))


s = input()
L = len(s)
lst = []
i = 0
while i < L:
	if s[i] == 'v':
		while i + 1 < L and s[i + 1] == 'v':
			lst.append('w')
			i += 1
	else:
		lst.append('o')
	i += 1
count = 0
for x in lst:
	if x == 'w':
		count += 1
prev = 0
total = 0
for x in lst:
	if x == 'w':
		prev += 1
	else:
		total += (count - prev) * prev
print(total)


s = input()
dp = [0 for i in range(len(s))]
i = 0
while i < len(s) - 1:
	if s[i] == 'v' and s[i + 1] == 'v':
		dp[i + 1] = dp[i] + 1
	else:
		dp[i + 1] = dp[i]
	i = i + 1
ans = 0
n = len(s) - 1
for i in range(1, len(s) - 1):
	if s[i] == 'o':
		ans = ans + dp[i - 1] * (dp[n] - dp[i + 1])
print(ans)


A = input()
(V, O) = ([], [])
(v, o) = (0, 0)
for val in A:
	if val == 'v':
		v += 1
		if v > 1 and o > 0:
			O.append(o)
			o = 0
	if val == 'o':
		o += 1
		if v > 1:
			V.append(v - 1)
		v = 0
if v > 1:
	V.append(v - 1)
if len(V) > 0 and len(O) > 0:
	Sum = V[-1]
	Suffix = [Sum]
	for val in V[::-1][1:]:
		Sum += val
		Suffix.append(Sum)
	Suffix = Suffix[::-1][1:]
	Another = []
	count = 0
	for (a, b) in zip(Suffix[::-1], O[::-1]):
		count += a * b
		Another.append(count)
	Another = Another[::-1]
	Ans = 0
	for n in range(len(V) - 1):
		Ans += Another[n] * V[n]
	print(Ans)
else:
	print(0)


s = list(input())
from math import *
dp = [0 for i in range(s.count('o') + 2)]
c = 0
j = 1
for i in range(len(s)):
	if s[i] == 'o':
		dp[j] = dp[j - 1] + max(0, c - 1)
		j += 1
		c = 0
	else:
		c += 1
s = 0
dp[len(dp) - 1] = dp[len(dp) - 2] + max(0, c - 1)
for i in range(1, len(dp) - 1):
	z = dp[len(dp) - 1] - dp[i]
	s += dp[i] * z
print(s)


s = str(input())
vv = o = c = 0
for i in range(len(s)):
	if s[i] == 'o':
		o += vv
	elif i > 0 and s[i - 1] == 'v':
		vv += 1
		c += o
print(c)


s = input()
ns = ''
w = 0
wa = []
for i in range(len(s) - 1):
	if s[i] == 'o':
		ns += 'o'
		wa.append(w)
	if s[i] == 'v' and s[i] == s[i + 1]:
		ns += 'w'
		w += 1
		wa.append(w)
ans = 0
for i in range(len(ns)):
	if ns[i] == 'o':
		ans += wa[i] * (w - wa[i])
print(ans)


s = input()
sum_v = 0
for i in range(len(s) - 1):
	if s[i] + s[i + 1] == 'vv':
		sum_v += 1
a = []
current_sum = 0
for i in range(len(s) - 1):
	if s[i] + s[i + 1] == 'vv':
		current_sum += 1
	elif s[i] == 'o':
		a.append((sum_v - current_sum) * current_sum)
print(sum(a))


s = input()
cnt = 1
dp = []
for i in range(1, len(s)):
	if s[i] != s[i - 1]:
		dp.append(cnt)
		cnt = 1
	else:
		cnt += 1
dp.append(cnt)
if s[0] == 'o':
	o = dp[::2]
	w = dp[1::2]
	imos = [0]
	for i in range(len(w)):
		imos.append(imos[i] + w[i] - 1)
	ans = 0
	for i in range(len(o)):
		if i < len(imos):
			ans += o[i] * (imos[i] - imos[0]) * (imos[-1] - imos[i])
	print(ans)
else:
	o = dp[1::2]
	w = dp[::2]
	imos = [0]
	for i in range(len(w)):
		imos.append(imos[i] + w[i] - 1)
	ans = 0
	for i in range(len(o)):
		if i + 1 < len(imos):
			ans += o[i] * (imos[i + 1] - imos[0]) * (imos[-1] - imos[i + 1])
	print(ans)


import math
import sys
DEBUG = False

def inp():
	return sys.stdin.readline().rstrip()

def dprint(*value, sep=' ', end='\n'):
	if DEBUG:
		print(*value, sep=sep, end=end)

def solve(S):
	vv = 0
	o = 0
	cnt = 0
	N = len(S)
	for i in range(N):
		if S[i:i + 2] == 'vv':
			cnt += o
			vv += 1
		elif S[i] == 'o':
			o += vv
	return cnt

def main():
	S = inp()
	print(solve(S))
main()


s = input()
wcount = 0
for i in range(len(s) - 1):
	if s[i + 1] == 'v' and s[i] == 'v':
		wcount += 1
ans = 0
wcountl = 0
for i in range(len(s) - 1):
	if s[i + 1] == 'v' and s[i] == 'v':
		wcountl += 1
		wcount -= 1
	elif s[i + 1] == 'o':
		ans += wcountl * wcount
print(ans)


s = input()
n = len(s)
(a, b, c) = (0, 0, 0)
for i in range(1, n):
	if s[i] == 'o':
		a += b
	elif s[i - 1] == 'v':
		b += 1
		c += a
print(c)


S = input()
Q = [0]
I = 0
out = 0
Sym = 0
for i in range(len(S) - 1):
	a = S[i]
	if a == 'v' and S[i + 1] == 'v':
		Q[I] += 1
		Sym += 1
	if a == 'o':
		Q.append(0)
		I += 1
Mys = Q[0]
for i in range(1, len(Q)):
	out += Mys * (Sym - Mys)
	Mys += Q[i]
print(out)


s = input()
l = len(s)
a = [[s[0], 1]]
j = 0
l = 0
r = 0
lstore = [0] * (len(s) + 1)
rstore = [0] * (len(s) + 1)
for i in range(len(s) - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		l += 1
	elif s[i] == 'o':
		lstore[i] = l
ans = 0
for i in range(len(s) - 1, 0, -1):
	if s[i] == 'v' and s[i - 1] == 'v':
		r += 1
	elif s[i] == 'o':
		rstore[i] = r
		ans = ans + lstore[i] * rstore[i]
print(ans)


a = input()
if len(set(a)) == 1:
	print(0)
else:
	l = 0
	d = []
	(v, o) = (0, 0)
	for i in range(len(a)):
		if l == 0:
			if a[i] == 'v':
				l = 1
				v = 1
		elif v > 0:
			if a[i] == 'v':
				v += 1
			else:
				d.append(v - 1)
				(v, o) = (0, 1)
		elif o > 0:
			if a[i] == 'v':
				d.append(o)
				(v, o) = (1, 0)
			else:
				o += 1
	if v > 0:
		d.append(v - 1)
	else:
		d.append(o)
	i = 0
	sum_v = 0
	while i >= 0 and i < len(d):
		sum_v += d[i]
		i += 2
	left_v = d[0]
	right_v = sum_v - left_v
	s = 0
	for i in range(1, len(d), 2):
		s += left_v * d[i] * right_v
		if i + 1 < len(d):
			left_v += d[i + 1]
			right_v -= d[i + 1]
		else:
			break
	print(s)


import sys
inf = float('inf')
from bisect import bisect_left, bisect_right

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
string = input()
length = len(string)
result = [0] * length
for i in range(1, length):
	if string[i] == 'v' and string[i - 1] == 'v':
		result[i] = result[i - 1] + 1
	else:
		result[i] = result[i - 1]
total = 0
for i in range(length - 1):
	if string[i] == 'o':
		total += result[i] * (result[length - 1] - result[i + 1])
print(total)


s = input()
ans = 0
arr = s.split('o')
wsall = 0
for i in arr:
	if len(i) > 1:
		wsall += len(i) - 1
ws = 0
for i in range(len(arr) - 1):
	if len(arr[i]) > 1:
		ws += len(arr[i]) - 1
		wsall -= len(arr[i]) - 1
	ans += ws * wsall
print(ans)


s = input()
n = len(s)
b = store = ans = change = prev_ans = another_var = all = temp = 0
for i in range(n - 1):
	if s[i] == s[i + 1] == 'v':
		if change:
			temp = b
		ans += prev_ans + store * temp
		if change:
			another_var = prev_ans + store * temp
		change = 0
		all += 1
		b = 0
	elif s[i] == 'o':
		prev_ans = another_var
		change = 1
		store = all
		b += 1
print(ans)


import sys
(mod, MOD) = (1000000007, 998244353)

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
string = input()
n = len(string)
dp = [0] * n
for i in range(1, n):
	if string[i] == 'v' and string[i - 1] == 'v':
		dp[i] = dp[i - 1] + 1
	else:
		dp[i] = dp[i - 1]
result = 0
for i in range(1, n - 1):
	if string[i] == 'o':
		result += dp[i - 1] * (dp[n - 1] - dp[i + 1])
print(result)


s = input()
(lst, k, length) = ([], 1, 0)
for (i, x) in enumerate(s[:-1]):
	if x == s[i + 1]:
		k += 1
	else:
		lst.append(k)
		k = 1
		length += 1
lst.append(k)
length += 1
if s[0] == 'o':
	lst.pop(0)
	length -= 1
if length % 2 == 0:
	if length > 0:
		lst.pop()
		length -= 1
(summa1, summa2, res) = (0, 0, 0)
for i in range(0, length, 2):
	summa1 += lst[i] - 1
for i in range(1, length, 2):
	summa2 += lst[i - 1] - 1
	res += summa2 * max(0, summa1 - summa2) * lst[i]
print(res)


s = list(input())
n = len(s)
if n < 5:
	print(0)
else:
	total_v = 0
	local_v = 0
	list_o = []
	for i in range(1, n):
		if s[i] == 'o':
			list_o.append(local_v)
		elif s[i - 1] == 'v':
			total_v += 1
			local_v += 1
	ans = 0
	for o in list_o:
		ans += (total_v - o) * o
	print(ans)


s = input()
n = len(s)
i = 0
while i < n and s[i] == 'o':
	i += 1
s = s[i:]
while len(s) > 0 and s[-1] == 'o':
	s = s[:-1]
n = len(s)

def sol(s, n):
	v = []
	o = []
	new_v = True
	new_o = True
	for i in range(len(s)):
		item = s[i]
		if item == 'v':
			if new_v:
				new_o = True
				v.append(1)
				new_v = False
			else:
				v[-1] += 1
		else:
			new_v = True
			if new_o:
				o.append(1)
				new_o = False
			else:
				o[-1] += 1
	if len(v) < 2:
		print(0)
		return
	if len(o) < 1:
		print(0)
		return
	to_left = [-1 for i in range(len(o))]
	to_left[0] = v[0] - 1
	to_right = [-1 for i in range(len(o))]
	to_right[-1] = v[-1] - 1
	for i in range(1, len(o)):
		to_left[i] = to_left[i - 1] + v[i] - 1
	for i in range(len(o) - 2, -1, -1):
		to_right[i] = to_right[i + 1] + v[i + 1] - 1
	ans = 0
	for i in range(len(o)):
		ans += o[i] * to_left[i] * to_right[i]
	print(ans)
sol(s, n)


from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 10 ** 9 + 7

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
s = st()
l1 = [0 for i in range(len(s))]
l2 = l1[:]
for i in range(1, len(s)):
	l1[i] = l1[i - 1]
	if s[i - 1] == 'v' and s[i] == 'v':
		l1[i] += 1
for i in range(len(s) - 2, -1, -1):
	l2[i] = l2[i + 1]
	if s[i] == 'v' and s[i + 1] == 'v':
		l2[i] += 1
tot = 0
for i in range(len(s)):
	if s[i] == 'o':
		tot += l1[i] * l2[i]
print(tot)


s = input()
spl = s.split('o')
for i in range(len(spl)):
	some = max(len(spl[i]) - 1, 0)
	spl[i] = some
ans = 0
(one, two) = (0, sum(spl))
for i in range(len(spl)):
	x = spl[i]
	ans += one * two
	one += x
	two -= x
print(ans)


l = input()
l += 'p'
pre = [0] * (len(l) + 1)
for i in range(1, len(l) + 1):
	pre[i] = pre[i - 1]
	if l[i - 1] == 'v' and l[i] == 'v':
		pre[i] += 1
ans = 0
for i in range(len(l)):
	if l[i] == 'o':
		ans += pre[i + 1] * (pre[len(l)] - pre[i + 1])
print(ans)


a = input()
count = 0
counts = []
total = 0
for i in range(len(a) - 1):
	if a[i] == 'v' and a[i + 1] == 'v':
		count += 1
	if a[i] == 'o':
		counts.append(count)
for c in counts:
	total += c * (count - c)
print(total)


def rint():
	return int(input())

def rints():
	return list(map(int, input().split()))
s = input()
prev_w = 0
prev_wo = 0
cons_v = 0
wow = 0
for c in s:
	if c == 'v':
		cons_v += 1
	else:
		if cons_v > 0:
			wow += prev_wo * (cons_v - 1)
			prev_w += cons_v - 1
			cons_v = 0
		prev_wo += prev_w
if cons_v > 0:
	wow += prev_wo * (cons_v - 1)
print(wow)


s = input()
dp = [0 for i in range(3)]
n = len(s)
for i in range(n):
	if i + 1 < n:
		if s[i] == 'v' and s[i + 1] == 'v':
			dp[0] += 1
			dp[2] += dp[1]
	if s[i] == 'o':
		dp[1] += dp[0]
print(dp[2])


import sys, re, math
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from heapq import heappush, heappop, heapify, nlargest, nsmallest

def STR():
	return list(input())

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST():
	return list(map(int, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def sortListWithIndex(listOfTuples, idx):
	return sorted(listOfTuples, key=lambda x: x[idx])

def sortDictWithVal(passedDic):
	temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))[::-1]
	toret = {}
	for tup in temp:
		toret[tup[0]] = tup[1]
	return toret

def sortDictWithKey(passedDic):
	return dict(OrderedDict(sorted(passedDic.items())))
INF = float('inf')
mod = 10 ** 9 + 7
s = input()
a = b = c = 0
for i in range(len(s)):
	if s[i] == 'o':
		b += a
	elif i > 0 and s[i - 1] == 'v':
		a += 1
		c += b
print(c)


s = input()
a = [0] * len(s)
b = [0] * len(s)
one = -1
x = 0
n = len(s)
if s[0] == 'v':
	one += 1
for i in range(1, n):
	if s[i] == 'v':
		one += 1
	else:
		x += max(0, one)
		a[i] = x
		one = -1
one = -1
if s[-1] == 'v':
	one += 1
x = 0
for i in range(len(s) - 2, -1, -1):
	if s[i] == 'v':
		one += 1
	else:
		x += max(0, one)
		b[i] = x
		one = -1
ans = 0
for i in range(n):
	if s[i] == 'o':
		ans += a[i] * b[i]
print(ans)


s = input()
n = len(s)
o = 0
w = 0
k = 0
for i in range(n - 1):
	if s[i] == s[i + 1] and s[i] == 'v':
		w += 1
		k += o
	elif s[i] == 'o':
		o += w
print(k)


word = input()
count = 0
oser = []
wser = []
for i in range(1, len(word)):
	if word[i] == 'v' and word[i - 1] == 'v':
		count += 1
	elif word[i] == 'o':
		oser.append(i + 1)
		wser.append(count)
wow = 0
for j in range(len(oser)):
	leftv = wser[j]
	rightv = count - leftv
	if leftv > 0 and rightv > 0:
		wow += leftv * rightv
	else:
		wow += 0
print(int(wow))


a = [0]
for x in input().split('o'):
	a += (a[-1] + max(0, len(x) - 1),)
print(sum((x * (a[-1] - x) for x in a)))


def find_w_count(s, n):
	w_count = []
	o_index = []
	if s[0] == 'o':
		o_index.append(0)
	w_count.append(0)
	for i in range(1, n):
		if s[i] == 'v' and s[i - 1] == 'v':
			w_count.append(w_count[i - 1] + 1)
		elif s[i] == 'o':
			o_index.append(i)
			w_count.append(w_count[i - 1])
		else:
			w_count.append(w_count[i - 1])
	return (w_count, o_index)

def main():
	s = input()
	n = len(s)
	(w_count, o_index) = find_w_count(s, n)
	wow = [0]
	for i in o_index:
		if i != 0 and wow and (i + 1 != n):
			wow.append(wow[-1] + w_count[i - 1] * (w_count[n - 1] - w_count[i + 1]))
	print(wow[-1])
main()


string = input()
prev = ''
n_string = []
for item in string:
	if item == prev and item == 'v':
		n_string.append('w')
	elif item == 'o':
		n_string.append(item)
	prev = item
counter = 0
prev = []
for item in n_string:
	if item == 'w':
		counter += 1
	prev.append(counter)
counter = 0
ahead = []
for item in reversed(n_string):
	if item == 'w':
		counter += 1
	ahead.append(counter)
counter = 0
n = len(n_string)
for i in range(n):
	if n_string[i] == 'o':
		counter += prev[i] * ahead[n - i - 1]
print(counter)


from sys import stdin, stdout, setrecursionlimit

class Tail_Recursion_Optimization:

	def __init__(self, RECURSION_LIMIT, STACK_SIZE):
		setrecursionlimit(RECURSION_LIMIT)
		threading.stack_size(STACK_SIZE)
		return None

class SOLVE:

	def solve(self):
		R = stdin.readline
		W = stdout.write
		s = R()
		l = len(s) - 1
		v_prefix = [0 for i in range(l)]
		v_suffix = [0 for i in range(l)]
		for i in range(l):
			if i == 0:
				v_prefix[i] = int(s[i] == 'v')
			elif s[i] == 'v':
				v_prefix[i] = v_prefix[i - 1] + 1
			elif s[i] == 'o':
				v_prefix[i] = v_prefix[i - 1] - int(s[i - 1] == 'v')
		for i in range(l - 1, -1, -1):
			if i == l - 1:
				v_suffix[i] = int(s[i] == 'v')
			elif s[i] == 'v':
				v_suffix[i] = v_suffix[i + 1] + 1
			elif s[i] == 'o':
				v_suffix[i] = v_suffix[i + 1] - int(s[i + 1] == 'v')
		total = 0
		for i in range(l):
			if s[i] == 'o':
				total += v_prefix[i] * v_suffix[i]
		W('%d\n' % total)
		return 0

def main():
	s = SOLVE()
	s.solve()
main()


s = input()
m = 0
b = 0
a = 0
for i in range(1, len(s)):
	if s[i] == 'v' and s[i - 1] == 'v':
		m += b
		a += 1
	if s[i] == 'o':
		b += a
print(m)


s = input()
n = len(s)
dp = [0] * (n + 1)
(count_zero, new_w, old_w, flag, res) = (0, 0, 0, False, 0)
for i in range(n - 1, -1, -1):
	if i > 0 and s[i] == s[i - 1] == 'v':
		if not flag:
			flag = True
			dp[i] = dp[i + 1] + old_w * count_zero
		else:
			dp[i] = dp[i + 1]
		res += dp[i]
		new_w += 1
	else:
		if s[i] == 'o':
			if flag:
				flag = False
				count_zero = 0
				old_w = new_w
			count_zero += 1
		dp[i] = dp[i + 1]
print(res)


str = input()
data = []
flag = 0
data.append(0)
str_len = len(str)
for (index, each) in enumerate(str, 1):
	if each == 'v' and flag == 0:
		data.append(data[index - 1])
		flag = 1
	elif each == 'v':
		data.append(data[index - 1] + 1)
	elif each == 'o':
		data.append(data[index - 1])
		flag = 0
ans = 0
for (index, each) in enumerate(str, 1):
	if each == 'o':
		ans += data[index] * (data[str_len] - data[index])
print(ans)


s = input()
import bisect
a = []
b = []
for i in range(len(s)):
	if s[i:i + 2] == 'vv':
		a.append(i)
	if s[i] == 'o':
		b.append(i)
na = len(a)
res = 0
for i in range(len(b)):
	x = bisect.bisect_left(a, b[i])
	if x < na:
		if a[x] != b[i]:
			res += x * (na - x)
print(res)


S = input()
wPrev = [0] * len(S)
wAft = [0] * len(S)
for i in range(1, len(S)):
	wPrev[i] = wPrev[i - 1]
	if S[i] == 'v' and S[i - 1] == 'v':
		wPrev[i] += 1
for i in range(len(S) - 2, -1, -1):
	wAft[i] = wAft[i + 1]
	if S[i] == 'v' and S[i + 1] == 'v':
		wAft[i] += 1
ans = 0
for i in range(len(S)):
	if S[i] == 'o':
		ans += wPrev[i] * wAft[i]
print(ans)


count = 0
s = input()
if len(s) < 5:
	print(0)
else:
	vvCount = 0
	i = 0
	while i < len(s):
		if s[i] == 'v':
			while i + 1 < len(s) and s[i + 1] == 'v':
				vvCount += 1
				i += 1
		i += 1
	left_vvCount = 0
	right_vvCount = vvCount
	for i in range(len(s) - 1):
		if s[i] == 'v' and s[i + 1] == 'v':
			left_vvCount += 1
			right_vvCount -= 1
		elif s[i] == 'o':
			count += left_vvCount * right_vvCount
	print(count)


(a, c, s, t) = (0, 0, 0, 0)
for i in input():
	if i == 'o':
		t += max(0, s - 1)
		c += t
		s = 0
	else:
		s += 1
		if s > 1:
			a += c
print(a)


s = input()
l = len(s)
ctotal = 0
sum = 0
cprev = 0
cfor = 0
for i in range(0, l - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		ctotal += 1
for i in range(0, l - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		cprev += 1
	if s[i] == 'o':
		cfor = ctotal - cprev
		sum = sum + cfor * cprev
print(sum)


s = input()
l = []
l.append(0)
x = 0
for i in s:
	if i == 'v':
		x = x + 1
	else:
		if x > 0:
			l.append(l[-1] + x - 1)
		else:
			l.append(l[-1])
		x = 0
if x > 0:
	l.append(l[-1] + x - 1)
ans = 0
for i in l:
	ans = ans + abs(i * (l[-1] - i))
print(ans)


import sys
input = sys.stdin.readline
s = input().rstrip()
w_prefix = [0]
for i in range(1, len(s)):
	if s[i - 1] == s[i] == 'v':
		w_prefix.append(w_prefix[-1] + 1)
	else:
		w_prefix.append(w_prefix[-1])
count = 0
for i in range(1, len(s)):
	char = s[i]
	if char == 'o':
		count += w_prefix[i - 1] * (w_prefix[-1] - w_prefix[i])
print(count)


s = input()
n = len(s)
t = []
wow = 0
w = 0
for i in range(n - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		w += 1
	elif s[i] == 'o':
		t.append(w)
for i in t:
	wow += i * (w - i)
print(wow)


s = input()
ahead = []
v = 0
count = 0
length = len(s)
suma = 0
for i in range(length):
	if s[i] == 'v':
		v += 1
	else:
		if v > 0:
			ahead.append(v - 1)
			suma += v - 1
		else:
			ahead.append(0)
		v = 0
back = 0
count = 0
if s[length - 1] != 'o':
	ahead.append(v - 1)
	suma += v - 1
for i in range(len(ahead)):
	back += ahead[i]
	count += back * (suma - back)
print(max(count, 0))


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools
from collections import deque, defaultdict, OrderedDict
import collections

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(1):
		s = rs()
		ns = ''
		for i in range(len(s) - 1):
			if s[i] == 'o':
				ns += 'o'
			if s[i] == 'v' and s[i] == s[i + 1]:
				ns += 'w'
		ns += 'o'
		for i in range(len(ns) - 1, -1, -1):
			if ns[i] == 'w':
				break
		for j in range(len(ns)):
			if ns[j] == 'w':
				break
		ns = ns[j:i + 1]
		wa = []
		w = 0
		for i in ns:
			if i == 'w':
				w += 1
			wa.append(w)
		ans = 0
		t = 0
		for i in range(len(ns)):
			if ns[i] == 'o':
				wbef = wa[i]
				waft = w - wa[i]
				ans += wbef * waft
		print(ans)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


s = input()
l = len(s)
c = 0
a = 0
c1 = 0
for i in range(0, l - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		c += 1
for i in range(0, l - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		c1 += 1
	if s[i] == 'o':
		a = a + c1 * (c - c1)
print(a)


s = input()
cnt = []
count = 0
for c in s:
	if c == 'v':
		count += 1
	else:
		if count >= 2:
			cnt.append(count - 1)
		else:
			cnt.append(0)
		count = 0
if count >= 2:
	cnt.append(count - 1)
else:
	cnt.append(0)
result = 0
cur = cnt[0]
cusum = [cur]
for x in cnt[1:]:
	cur += x
	cusum.append(cur)
for x in cusum:
	result += x * (cusum[-1] - x)
print(result)


s = input()
ans = 0
t = 0
temp = 0
for i in range(len(s)):
	if s[i] == 'v':
		temp += 1
		if i == len(s) - 1:
			if temp >= 2:
				t += temp - 1
	else:
		if temp >= 2:
			t += temp - 1
		temp = 0
w = 0
temp = 0
for i in range(len(s)):
	if s[i] == 'v':
		temp += 1
		if i == len(s) - 1:
			if temp >= 2:
				w += temp - 1
	else:
		if temp >= 2:
			w += temp - 1
		ans += w * (t - w)
		temp = 0
print(ans)


s = input()
count = []
c = 0
for i in s:
	if i == 'v':
		c += 1
	else:
		if c:
			count.append(c - 1)
		count.append('x')
		c = 0
if c > 0:
	count.append(c - 1)
total = 0
for i in count:
	if i != 'x':
		total += i
curr = 0
ans = 0
for i in count:
	if i == 'x':
		ans += curr * (total - curr)
	else:
		curr += i
print(ans)


s = input()
prefixSum = [0]
for i in range(len(s) - 1):
	prefixSum.append(prefixSum[-1] + (1 if s[i] == 'v' and s[i + 1] == 'v' else 0))
prefixSum = prefixSum[1:]
total = 0
for i in range(len(s) - 1):
	if s[i] == 'o':
		total += prefixSum[i] * (prefixSum[-1] - prefixSum[i])
print(total)


s = input()
a = [0]
for i in s.split('o'):
	a.append(a[-1] + max(0, len(i) - 1))
print(sum([x * (a[-1] - x) for x in a]))


import random
import math
from collections import defaultdict
import itertools
from sys import stdin, stdout
import sys
import operator

def main():
	z = ''
	d = defaultdict()
	t = 1
	s = input()
	l = len(s)
	a = [0] * l
	for i in range(l - 2, -1, -1):
		if s[i] == s[i + 1] and s[i] == 'v':
			a[i] = a[i + 1] + 1
		else:
			a[i] = a[i + 1]
	ans = 0
	for i in range(2, l):
		if s[i] == 'o':
			ans += a[i] * (a[0] - a[i])
	print(ans)
main()


s = input()
w = []
k = 0
for i in range(len(s) - 1):
	if s[i] == 'o':
		w += [k]
	elif s[i] == s[i + 1]:
		k += 1
s1 = 0
for i in w:
	s1 += i * (k - i)
print(s1)


s = input()
a = []
i1 = 0
while i1 < len(s):
	pos = s.find('v', i1)
	if pos < 0:
		break
	ocount = pos - i1 + 1
	i1 = s.find('o', pos + 1)
	if i1 < 0:
		i1 = len(s)
	d = i1 - pos
	a.append((d - 1, ocount))
	i1 += 1
b = 0
c = [0] * len(a)
for i in range(len(a)):
	b += a[i][1]
	a[i] = a[i][0]
	c[i] = a[i] * b
sa = [0] * len(a)
sc = [0] * len(a)
sa_val = 0
sc_val = 0
for i in range(len(a)):
	sa_val += a[i]
	sc_val += c[i]
	sa[i] = sa_val
	sc[i] = sc_val
ans = 0
for i in range(len(a)):
	ans += c[i] * sa[i] - a[i] * sc[i]
print(ans)


s = str(input())
n = len(s)
if n < 3:
	print(0)
else:
	left = [0 for i in range(n)]
	right = [0 for i in range(n)]
	count = 0
	if s[0] == 'v' and s[1] == 'v':
		left[1] = 1
	if s[n - 1] == 'v' and s[n - 2] == 'v':
		right[n - 2] = 1
	for i in range(2, n):
		if s[i] == s[i - 1] and s[i] == 'v':
			left[i] = left[i - 1] + 1
		else:
			left[i] = left[i - 1]
	for i in range(n - 3, -1, -1):
		if s[i] == s[i + 1] and s[i] == 'v':
			right[i] = right[i + 1] + 1
		else:
			right[i] = right[i + 1]
	ans = 0
	for i in range(1, n - 1):
		if s[i] == 'o':
			ans += left[i - 1] * right[i + 1]
	print(ans)


s = input()
f = [[0] * 3] * 2
cur = 0
for i in range(len(s)):
	cur ^= 1
	for j in range(3):
		f[cur][j] = f[cur ^ 1][j]
	if s[i] == 'v':
		if i > 0 and s[i - 1] == 'v':
			f[cur][0] = f[cur][0] + 1
			f[cur][2] += f[cur ^ 1][1]
	else:
		f[cur][1] += f[cur ^ 1][0]
print(f[cur][2])


b = list(map(len, input().split('o')))
a = []
for x in b:
	a.append(max(0, x - 1))
s = sum(a)
i = 0
ans = 0
for x in a:
	s -= x
	i += x
	ans += i * s
print(ans)


dp = [-1 for _ in range(10)]

def main():
	string = list(str(input()))
	if len(string) <= 4:
		print(0)
	else:
		ans = 0
		curr = 0
		final = 0
		for i in range(len(string) - 1):
			if string[i] == 'v' and string[i + 1] == string[i]:
				ans += 1
		for i in range(len(string)):
			if i < len(string) - 1 and string[i] == 'v' and (string[i + 1] == 'v'):
				ans -= 1
				curr += 1
			if string[i] == 'o':
				final += ans * curr
		print(final)
	return
main()


from itertools import groupby
s = input()
a = [len(tuple(v)) * (-1 if k == 'o' else 1) - (1 if k == 'v' else 0) for (k, v) in groupby(s)]
if a[0] < 0:
	a = a[1:]
if a and a[-1] < 0:
	a.pop()
if not a:
	print(0)
	exit()
ans = 0
right = sum((x for x in a if x > 0)) - a[0]
left = a[0]
for x in a[1:]:
	if x < 0:
		ans += left * -x * right
	else:
		left += x
		right -= x
print(ans)


def iter_groups(S):
	start = 0
	for i in range(1, len(S)):
		if S[i] != S[i - 1]:
			yield (S[start], i - start)
			start = i
	yield (S[start], len(S) - start)

def solve():
	S = input()
	if S == '':
		print(0)
		return
	ans = 0
	cntWL = 0
	cntWR = 0
	for (c, cnt) in iter_groups(S):
		if c == 'v':
			cntWR += cnt - 1
	for (c, cnt) in iter_groups(S):
		if c == 'v':
			cntWL += cnt - 1
			cntWR -= cnt - 1
		else:
			ans += cntWL * cnt * cntWR
	print(ans)
solve()


def process(string):
	(num, vNum, lastWasV, lastV, Oseen) = (0, 0, False, 0, 0)
	for i in range(len(string) - 2, -1, -1):
		if string[i] == 'o':
			lastWasV = False
			Oseen += 1
		elif string[i + 1] == 'v':
			if lastWasV:
				num += lastV
			else:
				lastV += vNum * Oseen
				num += lastV
				(lastWasV, Oseen) = (True, 0)
			vNum += 1
	print(num)
process(input())


s = input()
n = len(s)
to_right = sum([1 for i in range(n - 1) if s[i] == 'v' and s[i + 1] == 'v'])
to_left = 0
ans = 0
for i in range(n):
	if s[i] == 'o':
		ans += to_right * to_left
	elif i + 1 < n and s[i + 1] == 'v':
		to_right -= 1
		to_left += 1
print(ans)


import sys, math, queue, bisect
MOD = 10 ** 9 + 7
sys.setrecursionlimit(1000000)
s = 'o' + input()
n = len(s)
v = []
o = []
for i in range(n):
	if s[i] == 'o':
		if len(o) == 0 or s[i - 1] != 'o':
			o.append(1)
		else:
			o[-1] += 1
		if len(v) == 0 or v[-1] != 0:
			v.append(0)
	else:
		v[-1] += 1
if v[-1] == 0:
	v.pop()
if s[-1] == 'o':
	o.pop()
for i in range(len(v)):
	v[i] -= 1
pv = 0
nx = sum(v)
ans = 0
for i in range(1, len(v)):
	pv += v[i - 1]
	nx -= v[i - 1]
	ans += pv * nx * o[i]
print(ans)


s = input()
n = len(s)
b = []
for j in s:
	b.append(j)
c = [0] * (n + 1)
d = [0] * (n + 1)
j = 0
k = 0
while j < n - 1:
	if b[j] == 'v' and b[j + 1] == 'v':
		k += 1
	if b[j] == 'o':
		c[j] = k
	j += 1
j = n - 1
k = 0
while j > 0:
	if b[j] == 'v' and b[j - 1] == 'v':
		k += 1
	if b[j] == 'o':
		d[j] = k
	j += -1
res = 0
j = 0
while j < n:
	if b[j] == 'o':
		res += c[j] * d[j]
	j += 1
print(res)


string = input()
n = len(string)
lst1 = [0] * n
lst2 = [0] * n
i = 0
pre = 0
while i < n:
	start = i
	while i < n and string[i] == 'v':
		i += 1
	if i != n:
		if i - start - 1 > 0:
			lst1[i] = pre + (i - start - 1)
			pre = lst1[i]
		else:
			lst1[i] = pre
	i += 1
new_string = string
i = n - 1
pre = 0
while i >= 0:
	start = i
	while i >= 0 and new_string[i] == 'v':
		i -= 1
	if i != -1:
		if start - i - 1 > 0:
			lst2[i] = pre + (start - i - 1)
			pre = lst2[i]
		else:
			lst2[i] = pre
	i -= 1
ans = 0
for i in range(n):
	ans = ans + lst1[i] * lst2[i]
print(ans)


s = input()
l = []
for i in range(len(s) - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		l.append('w')
	elif s[i] != 'v':
		l.append(s[i])
if s[-1] != 'v':
	l.append(s[-1])
w = []
cnt = 0
for i in range(len(l)):
	if l[i] == 'w':
		cnt += 1
		w.append(cnt)
	else:
		w.append(0)
maxx = last = summ = 0
for i in range(len(w) - 1, -1, -1):
	if w[i] != 0:
		last = w[i]
		break
for i in range(len(w)):
	maxx = max(maxx, w[i])
	if w[i] == 0:
		summ += (last - maxx) * maxx
print(summ)


s = input()
ctr = 0
w = 0
o = 0
t = 0
for i in range(0, len(s) - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		w += 1
		ctr += t
		continue
	if s[i] == 'o':
		o += 1
		t += w
		continue
	else:
		continue
print(ctr)


s = input()
suffix = [0 for _ in range(len(s))]
r_ones = 0
for i in range(len(s) - 2, -1, -1):
	if s[i] == 'v' and s[i + 1] == 'v':
		r_ones += 1
	suffix[i] = r_ones
l_ones = 0
ans = 0
for i in range(1, len(s)):
	if s[i] == 'v' and s[i - 1] == 'v':
		l_ones += 1
	elif s[i] == 'o':
		r_ones = suffix[i]
		ans += l_ones * r_ones
print(ans)


from sys import stdin, stdout
from bisect import bisect_right as br
from bisect import bisect_left as bl
from bisect import insort_left as il
from math import gcd
s = stdin.readline()
l = 0
r = 0
prev = s[0]
for i in s[1:]:
	if prev == 'v' and i == 'v':
		r += 1
	prev = i
cur = 0
prev = 0
ans = 0
for i in s:
	if i == 'o':
		k = s[prev:cur].count('v')
		if k > 0:
			l += k - 1
			r -= k - 1
		ans += l * r
		prev = cur
	cur += 1
stdout.write(str(ans))


s = input()
counts = [0, 0, 0]
for i in range(1, len(s)):
	new_counts = counts[:]
	if s[i] == 'v' and s[i - 1] == 'v':
		new_counts[0] += 1
		new_counts[2] += new_counts[1]
	elif s[i] == 'o':
		new_counts[1] += new_counts[0]
	counts = new_counts
print(counts[2])


s = input()
s1 = ''
v = 0
for i in s:
	if i == 'v':
		v += 1
	else:
		if v > 1:
			s1 += 'w' * (v - 1)
		v = 0
		s1 += i
if v > 1:
	s1 += 'w' * (v - 1)
w = 0
ans = 0
total = s1.count('w')
for i in s1:
	if i == 'w':
		w += 1
	else:
		ans += w * (total - w)
print(ans)


SUM = 0
X = input().strip('o')
if X.count('o') == 0:
	print(0)
	exit()
Size = len(X)
(BeforeV, AfterV) = (0, 0)
for i in range(Size - 1):
	if X[i] + X[i + 1] == 'vv':
		AfterV += 1
for i in range(Size - 1):
	if X[i] == 'o':
		SUM += BeforeV * AfterV
	if X[i] + X[i + 1] == 'vv':
		BeforeV += 1
		AfterV -= 1
print(SUM)


s = input()
V = [0] * len(s)
O = [0] * len(s)
c = 0
for i in range(1, len(s)):
	if s[i] == s[i - 1] and s[i] == 'v':
		V[i] = V[i - 1] + 1
		c += O[i - 1]
	else:
		V[i] = V[i - 1]
	if s[i] == 'o':
		O[i] = O[i - 1] + V[i - 1]
	else:
		O[i] = O[i - 1]
print(c)


s = [max(0, len(x) - 1) for x in input().split('o')]
R = sum(s)
L = 0
ans = 0
for x in s:
	L += x
	R -= x
	ans += L * R
print(ans)


def countSubsequence(s, n):
	cntG = 0
	cntF = 0
	result = 0
	C = 0
	for i in range(n):
		if s[i] == 'w':
			cntG += 1
			result += C
			continue
		if s[i] == 'o':
			cntF += 1
			C += cntG
			continue
		else:
			continue
	return result
s = input()
ctr = 0
n_w = 0
l = []
for i in range(len(s) - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		n_w += 1
		l.append('w')
	else:
		l.append(s[i])
if s[-1] != 'v':
	l.append(s[-1])
print(countSubsequence(l, len(l)))


(a, b, c) = (0, 0, 0)
z = input()
for i in range(1, len(z)):
	if z[i] == 'v' and z[i - 1] == 'v':
		a += 1
		c += b
	elif z[i] == 'o':
		b += a
print(c)


s = input()
n = len(s)
a = 0
for i in range(n - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		a += 1
p = 0
c = 0
d = 0
for i in range(n - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		c += 1
	if s[i] == 'o':
		d += 1
	if s[i] == 'o' and s[i + 1] == 'v':
		p += d * c * (a - c)
		d = 0
print(p)


s = str(input())
(i, o_count, size, total) = (0, 0, 0, 0)
ans = 0
for x in range(len(s) - 1):
	if s[x] == 'v' and s[x + 1] == 'v':
		i = x + 1
		size = 1
		break
for x in range(i, len(s) - 1):
	if s[x] == 'o':
		o_count += 1
	elif s[x] == 'v' and s[x + 1] == 'v':
		ans += o_count * size - total
		total += o_count
		size += 1
print(ans)


from sys import maxsize, stdout, stdin, stderr
mod = int(1000000000.0 + 7)

def I():
	return int(stdin.readline())

def lint():
	return [int(x) for x in stdin.readline().split()]

def S():
	return input().strip()

def grid(r, c):
	return [lint() for i in range(r)]
from collections import defaultdict, Counter
import math
import heapq
from heapq import heappop, heappush
import bisect
from itertools import groupby

def gcd(a, b):
	while b:
		a %= b
		tmp = a
		a = b
		b = tmp
	return a

def lcm(a, b):
	return a / gcd(a, b) * b

def check_prime(n):
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def Bs(a, x):
	i = 0
	j = 0
	left = 0
	right = len(a)
	flag = False
	while left < right:
		mi = (left + right) // 2
		if a[mi] <= x:
			left = mi + 1
			i += 1
		else:
			right = mi
			j += 1
	if left > 0 and a[left - 1] == x:
		return (i - 1, j)
	else:
		return (-1, -1)
s = input()
n = len(s)
a = 0
su = 0
l = []
for i in range(n - 1):
	if s[i] == 'o':
		l.append(a)
	elif s[i + 1] == 'v':
		a += 1
		su += 1
ans = 0
for i in l:
	ans += (su - i) * i
print(ans)


s = input('')
a = list(s)
ans = 0
vc = 0
firstv = -1
for i in range(len(s) - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		firstv = i
		break
if firstv == -1:
	print('0')
	exit()
i = firstv
oc = 0
wc = 0
while i < len(s) - 1:
	if s[i] == 'v':
		while i < len(s):
			i += 1
			if i == len(s):
				break
			if s[i] == 'v':
				wc += 1
				ans += oc
			else:
				i -= 1
				break
	else:
		oc += wc
	i += 1
print(ans)


s = input()
dp = [0 for i in range(len(s))]
for i in range(1, len(s)):
	if s[i - 1:i + 1] == 'vv':
		dp[i] = dp[i - 1] + 1
	else:
		dp[i] = dp[i - 1]
ans = 0
for i in range(len(s)):
	if s[i] == 'o':
		if i > 0:
			ans += dp[i - 1] * (dp[len(s) - 1] - dp[i])
print(ans)


def int_list():
	return [int(c) for c in input().split()]

def int1():
	return int(input())

def str_list():
	return [c for c in input().split()]

def str1():
	return input()
s = str1()
s += 'o'
curr = 0
behind = [0]
front = [0]
front_app = []
for j in range(len(s)):
	c = s[j]
	if c == 'v':
		curr += 1
	else:
		if curr >= 2:
			behind.append(behind[-1] + curr - 1)
		else:
			behind.append(behind[-1])
		front.append(0)
		if curr >= 2:
			front_app.append((len(front) - 2, curr - 1))
		curr = 0
inc = 0
app_ind = len(front_app) - 1
ind = 0
curr_inc = 0
if app_ind >= 0:
	(ind, curr_inc) = front_app[app_ind]
for j in reversed(range(len(front))):
	if j == ind:
		inc += curr_inc
		app_ind -= 1
		if app_ind >= 0:
			(ind, curr_inc) = front_app[app_ind]
	front[j] += inc
res = 0
for i in range(len(behind)):
	res += behind[i] * front[i]
print(res)


s = input()
(l, n) = ([], len(s))
i = 0
while i < n:
	j = i
	while j < n and s[j] == 'v':
		j += 1
	l.append(max(j - i - 1, 0))
	i = j
	while j < n and s[j] == 'o':
		j += 1
	l.append(j - i)
	i = j
dp = [0, 0, 0]
for i in range(len(l)):
	if i & 1:
		dp[1] += dp[0] * l[i]
	else:
		dp[2] += dp[1] * l[i]
		dp[0] += l[i]
print(dp[-1])


s = input()
n = len(s)
if n <= 2:
	print(0)
	exit()
wSums = [0]
totalW = 0
for i in range(1, n):
	if s[i] == 'v' and s[i - 1] == 'v':
		totalW += 1
	wSums.append(totalW)
wowFactor = 0
for (i, c) in enumerate(s):
	if c == 'o' and i >= 1:
		wowFactor += wSums[i - 1] * (totalW - wSums[i - 1])
print(wowFactor)


s = input()
n = len(s)
num_vv = 0
num_vvo = 0
num_vvovv = 0
for i in range(1, n):
	if s[i] == 'o':
		num_vvo += num_vv
	elif s[i] == s[i - 1]:
		num_vv += 1
		num_vvovv += num_vvo
print(num_vvovv)


st = input()
w_counter = 0
wo_counter = 0
wow_counter = 0
for k in range(len(st) - 1):
	if st[k:k + 2] == 'vv':
		w_counter += 1
		wow_counter += wo_counter
	elif st[k] == 'o':
		wo_counter += w_counter
print(wow_counter)


s = input()
(count_w, count_o, z) = (0, 0, False)
n = len(s)
total = 0
last = ''
count = 0
check = []
for i in range(n - 1, 0, -1):
	if s[i] == s[i - 1] == 'v':
		count_w += 1
	if s[i] == 'o':
		check.append(count_w)
		total += count_w
if s[0] == 'o':
	check.append(count_w)
	total += count_w
sum = total
count = 0
for i in range(n - 1):
	if s[i] == s[i + 1] == 'v':
		count += sum
	elif s[i] == 'o':
		b = check.pop()
		sum -= b
print(count)


s = input()
prefix = [0] * len(s)
for i in range(len(s) - 2, -1, -1):
	prefix[i] = prefix[i + 1] + (1 if s[i] == 'v' and s[i + 1] == 'v' else 0)
ans = 0
for i in range(len(s)):
	if s[i] == 'o':
		ans += (prefix[0] - prefix[i]) * prefix[i]
print(ans)


wows = input()
doublevs = 0
tot = 0
for i in range(1, len(wows)):
	if wows[i] == 'v':
		if wows[i - 1] == 'v':
			doublevs += 1
curr = 0
for i in range(1, len(wows)):
	if wows[i] == 'v' and wows[i - 1] == 'v':
		curr += 1
	elif wows[i] == 'o':
		tot += curr * (doublevs - curr)
print(str(tot))


s = input()
total_w = 0
for i in range(1, len(s)):
	if s[i] == 'v' and s[i - 1] == 'v':
		total_w += 1
n_w = 0
ans = 0
leng = len(s)
for i in range(1, leng - 1):
	if s[i] == 'v' and s[i - 1] == 'v':
		n_w += 1
	elif s[i] == 'o':
		ans += n_w * (total_w - n_w)
print(ans)


s = input()
a = 0
while a < len(s) and s[a] != 'v':
	a += 1
if a >= len(s):
	print(0)
else:
	total = 0
	nouv = ''
	nb_v = 0
	for i in range(len(s)):
		if s[i] == 'o':
			if nb_v > 1:
				nouv += 'v' * (nb_v - 1)
				total += nb_v - 1
			nb_v = 0
			nouv += 'o'
		else:
			nb_v += 1
	if nb_v > 1:
		nouv += 'v' * (nb_v - 1)
		total += nb_v - 1
	nb_v = 0
	res = 0
	for c in nouv:
		if c == 'v':
			nb_v += 1
		else:
			res += nb_v * (total - nb_v)
	print(res)


s = str(input())
arr1 = []
arr2 = []
countx = 0
i = 0
while i < len(s):
	if s[i] == 'o':
		arr1.append(countx)
		i += 1
	else:
		j = i
		while j < len(s) and s[j] == 'v':
			j += 1
		diff = j - i
		countx += diff - 1
		i = j
ans = 0
for i in range(len(arr1)):
	ans += arr1[i] * (countx - arr1[i])
print(ans)


from sys import stdin, stdout
from collections import Counter
import math

def rsingle_int():
	return int(stdin.readline().rstrip())

def rmult_int():
	return [int(x) for x in stdin.readline().rstrip().split()]

def rmult_str():
	return stdin.readline().rstrip().split()

def r_str():
	return stdin.readline().rstrip()

def rsingle_char():
	return stdin.read(1)
num = {0: {}, 1: {}, 2: {}, 3: {}, 4: {}, 5: {}, 6: {}, 7: {}}

def rec(str, i, sub, j):
	if i not in num[j]:
		val = 0
		if j == len(sub):
			val = 1
		elif i == len(str):
			val = 0
		elif sub[j] == 'o' and str[i] == sub[j]:
			val = rec(str, i + 1, sub, j + 1)
			val += rec(str, i + 1, sub, j)
		elif sub[j] == 'v' and i + 1 < len(str) and (str[i] == sub[j]) and (str[i + 1] == sub[j]):
			val = rec(str, i + 2, sub, j + 2)
			val += rec(str, i + 1, sub, j)
		else:
			val = rec(str, i + 1, sub, j)
		num[j][i] = val
	return num[j][i]

def main():
	str = r_str()
	sub = 'vvovv'
	wow = [5, 3, 2, 0]
	for j in wow:
		for i in range(len(str), -1, -1):
			if j == len(sub):
				val = 1
			elif i == len(str):
				val = 0
			elif sub[j] == 'o' and str[i] == sub[j]:
				val = num[j + 1][i + 1] + num[j][i + 1]
			elif sub[j] == 'v' and i + 1 < len(str) and (str[i] == sub[j]) and (str[i + 1] == sub[j]):
				val = num[j + 2][i + 2] + num[j][i + 1]
			else:
				val = num[j][i + 1]
			num[j][i] = val
	print(num[0][0])
main()


import sys
input = sys.stdin.readline
write = lambda x: sys.stdout.write(f'{x}\n')
s = input().strip()
arr = []
for i in s:
	if arr and arr[-1][0] == 'v':
		if i == 'v':
			arr[-1] = ['v', arr[-1][1] + 1]
		else:
			arr.append(['o', 1])
	elif arr and arr[-1][0] == 'o':
		if i == 'o':
			arr[-1] = ['o', arr[-1][1] + 1]
		else:
			arr.append(['v', 1])
	else:
		arr.append([i, 1])
prefix = [0]
suffix = [0]
for i in arr:
	if i[0] == 'v':
		prefix.append(prefix[-1] + i[1] - 1)
	else:
		prefix.append(prefix[-1])
for i in arr[::-1]:
	if i[0] == 'v':
		suffix.append(suffix[-1] + i[1] - 1)
	else:
		suffix.append(suffix[-1])
suffix = suffix[::-1]
suffix.pop()
prefix.pop(0)
ans = 0
for (i, j) in enumerate(arr):
	if j[0] == 'o' and i - 1 >= 0 and (i + 1 < len(arr)):
		ans += prefix[i - 1] * suffix[i + 1] * j[1]
print(ans)


s = input()
ws = []
i = 0
while i < len(s):
	cnt = 0
	while i < len(s) and s[i] == 'v':
		cnt += 1
		i += 1
	if cnt != 0:
		ws += ['w'] * (cnt - 1)
	if i >= len(s):
		break
	ws.append('o')
	i += 1
W = 0
WO = 0
WOW = 0
for c in ws:
	if c == 'w':
		W += 1
		WOW += WO
	else:
		WO += W
print(WOW)


s = str(input())
n = len(s)
dp = [0] * n
l = [0] * n
w1 = []
w2 = []
ans = 0
summ = 0
for i in range(n):
	if s[i] == 'v':
		if i == 0:
			dp[i] = 1
		else:
			dp[i] = dp[i - 1] + 1
		if i == n - 1:
			l[i] = dp[i]
	else:
		l[i] = -1
		if i != 0:
			if s[i - 1] == 'v':
				l[i - 1] = dp[i - 1]
i = 0
while i < n:
	if l[i] != 0 and l[i] != -1:
		t = 0
		w1.append(l[i])
		i += 1
		while i < n:
			if l[i] == -1:
				t += 1
				i += 1
			else:
				break
		w2.append(t)
	else:
		i += 1
for i in range(len(w1)):
	if w1[i] >= 2:
		w1[i] -= 1
	else:
		w1[i] = 0
ss = sum(w1)
for i in range(len(w1)):
	summ += w1[i]
	ans += w2[i] * summ * (ss - summ)
print(ans)


import math
from collections import defaultdict, Counter, deque
INF = float('inf')

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def primeFactor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i ** 2 <= n:
		if n % i == 0:
			return i
		i += 1
	return n

def main():
	s = input()
	o = 0
	w = 0
	ans = 0
	for i in range(len(s)):
		if s[i] == 'o':
			o += w
		elif i > 0 and s[i - 1] == 'v':
			w += 1
			ans += o
	print(ans)
t = 1
for _ in range(t):
	main()


a = input()
p = []
x = v = f = 0
for i in range(len(a)):
	if a[i] == 'o':
		x += v
		p.append(x)
		v = f = 0
	elif f:
		v += 1
	else:
		f = 1
x += v
for i in range(len(p)):
	p[i] *= x - p[i]
print(sum(p))


s = input()
n = len(s)
a = s.count('o')
(l, y) = (a * [0], a * [0])
(b, c) = (0, 0)
(z, x) = (0, -1)
for i in range(n - 1):
	if s[i] == 'v':
		if s[i + 1] == 'v':
			b += 1
	else:
		l[z] = b
		z += 1
for j in range(n - 1):
	if s[-j - 1] == 'v':
		if s[-j - 2] == 'v':
			c += 1
	else:
		y[x] = c
		x -= 1
d = 0
for u in range(a):
	d += l[u] * y[u]
print(d)


import sys

def main():
	s = sys.stdin.readline().strip()
	vc = [0]
	for i in range(1, len(s)):
		if s[i] == 'v' and s[i - 1] == 'v':
			vc.append(vc[i - 1] + 1)
		else:
			vc.append(vc[i - 1])
	n = vc[-1]
	res = 0
	for i in range(1, len(s)):
		if s[i] == 'o':
			res += vc[i] * (n - vc[i])
	print(res)
main()


s = input()
n = len(s)
li = []
cnt = 0
for i in range(n):
	if s[i] == 'v':
		cnt += 1
	elif cnt != 0:
		li.append(cnt)
		cnt = 0
		cnt = 0
if cnt != 0:
	li.append(cnt)
cnt = 0
li2 = []
flag = False
for i in range(n):
	if s[i] == 'v':
		flag = True
	if s[i] == 'o' and flag:
		cnt += 1
	elif cnt != 0:
		li2.append(cnt)
		cnt = 0
for i in range(len(li)):
	li[i] -= 1
ruiseki = [0] * (len(li) + 1)
for i in range(len(li)):
	ruiseki[i + 1] = ruiseki[i] + li[i]
ans = 0
for i in range(len(li) - 1):
	ans += li2[i] * ruiseki[i + 1] * (ruiseki[-1] - ruiseki[i + 1])
print(ans)


import io, sys, atexit, os
import math as ma
from decimal import Decimal as dec
from itertools import permutations
from itertools import combinations

def li():
	return list(map(int, input().split()))

def num():
	return map(int, input().split())

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	gg = find_gcd(x, y)
	return x * y // gg
mm = 1000000007
yp = 0

def solve():
	t = 1
	for tt in range(t):
		s = input()
		n = len(s)
		l = [0] * n
		for i in range(n - 1):
			if s[i] == s[i + 1] and s[i] == 'v':
				l[i] = 1
		pre = [0] * n
		suf = [0] * n
		pre[0] = l[0]
		for i in range(1, n):
			pre[i] = pre[i - 1] + l[i]
		suf[n - 1] = l[n - 1]
		for i in range(n - 2, -1, -1):
			suf[i] = suf[i + 1] + l[i]
		ans = 0
		for i in range(n):
			if s[i] == 'o':
				if i - 1 >= 0 and i + 1 < n:
					ans += pre[i - 1] * suf[i + 1]
		print(ans)

def __starting_point():
	solve()
__starting_point()


s = input().rstrip()
V = 0
O = 0
for i in range(0, len(s) - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		V += 1
	if s[i] == 'o':
		O += 1
A = 0
B = V
F = 0
for i in range(0, len(s) - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		A += 1
		B -= 1
	if s[i] == 'o':
		if A != 0 and B != 0:
			F = F + A * B
print(F)


from sys import stdin
input = stdin.readline
s = input()
x = 0
y = 0
ans = 0
for i in range(1, len(s)):
	if s[i] == 'v' and s[i - 1] == 'v':
		x += 1
for i in range(1, len(s)):
	if s[i] == 'v' and s[i - 1] == 'v':
		x -= 1
		y += 1
	elif s[i] == 'o':
		ans += y * x
print(ans)


s = input()
left = []
k = 0
for i in range(len(s)):
	if s[i] == 'o':
		left.append(k)
	elif i and s[i - 1] == 'v':
		k += 1
right = []
k = 0
for i in range(len(s) - 1, -1, -1):
	if s[i] == 'o':
		right.append(k)
	elif i < len(s) - 1 and s[i + 1] == 'v':
		k += 1
right = right[::-1]
ans = 0
for i in range(len(left)):
	ans += left[i] * right[i]
print(ans)


import sys
input = lambda : sys.stdin.readline().strip()
s = input()
flip = 'v'
i = 0
res = []
while i < len(s):
	cnt = 0
	while i < len(s) and s[i] == flip:
		cnt += 1
		i += 1
	if flip == 'v':
		res.append(max(0, cnt - 1))
		flip = 'o'
	else:
		res.append(cnt)
		flip = 'v'
Sum = 0
forward = []
for i in range(len(res)):
	if i % 2 == 0:
		Sum += res[i]
	forward.append(Sum)
backward = []
Sum = 0
for i in range(len(res) - 1, -1, -1):
	if i % 2 == 0:
		Sum += res[i]
	backward.append(Sum)
backward.reverse()
ans = 0
for i in range(len(res)):
	if i % 2:
		ans += forward[i] * backward[i] * res[i]
print(ans)


from collections import defaultdict
s = input()
hash = defaultdict(list)
la = []
count = 0
sum = 0
for i in range(len(s)):
	if s[i] == 'o':
		if count > 0:
			la.append(count - 1)
		else:
			la.append(0)
		count = 0
	else:
		count += 1
if count != 0:
	la.append(count - 1)
else:
	la.append(0)
dp = []
pref = [0]
for i in range(len(la)):
	pref.append(pref[-1] + la[i])
j = 1
ans = 0
for i in range(len(s)):
	if s[i] == 'o':
		ans += la[j - 1] * (pref[-1] - pref[j]) + pref[j - 1] * (pref[-1] - pref[j])
		j += 1
print(ans)


def count(temp, n):
	cw = 0
	co = 0
	result = 0
	C = 0
	for i in range(n):
		if temp[i] == 'w':
			cw += 1
			result += C
			continue
		if temp[i] == 'o':
			co += 1
			C += cw
			continue
		else:
			continue
	return result
string = input()
temp = []
for i in range(len(string) - 1):
	if string[i] == 'v' and string[i + 1] == 'v':
		temp.append('w')
	elif string[i] == 'o':
		temp.append('o')
print(count(temp, len(temp)))


s = input()
n = len(s)
a = []
for i in range(len(s)):
	if i != n - 1 and s[i] == 'v' and (s[i + 1] == 'v'):
		a.append('w')
	elif s[i] != 'v':
		a.append(s[i])
dp = [0]
c = 0
for x in a[::-1]:
	if x == 'w':
		c += 1
	else:
		dp.append(c)
dp = dp[1:][::-1]
wc = 0
ans = 0
c = 0
for x in ''.join(a):
	if x == 'w':
		wc += 1
	if x == 'o':
		ans += wc * dp[c]
		c += 1
print(ans)


s = input()
cnt = 0
for i in range(len(s) - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		cnt += 1
cc = 0
ans = 0
for i in range(len(s) - 2):
	if s[i] == 'o':
		ans += cc * (cnt - cc)
	elif s[i] == s[i + 1] and s[i + 1] == 'v':
		cc += 1
print(ans)


from collections import *
from math import *
s = list(input())
n = len(s)
i = 0
a = []
while i < n:
	ctv = 0
	while i < n and s[i] != 'o':
		i += 1
		ctv += 1
	cto = 0
	a.append(ctv)
	while i < n - 1 and (not (s[i] == 'v' and s[i + 1] == 'v')):
		if s[i] == 'o':
			cto += 1
		i += 1
	a.append(cto)
	if i == n - 1:
		break
a.pop()
st = 0
if a[0] < 2:
	st = 2
n = len(a)
ans = 0
ct3 = 0
ct1 = 0
for i in range(n - 1, st - 1, -2):
	ct3 += a[i] - 1
for i in range(st, n - 2, 2):
	ct1 += a[i] - 1
	ct2 = a[i + 1]
	ct3 -= a[i] - 1
	ans += ct1 * ct2 * ct3
print(ans)


import sys
input = sys.stdin.readline
s = input().strip()
ANS = 0
BEFORE = 0
OCOUNT = 0
LEN = len(s)
for i in range(1, LEN):
	if s[i] == 'v' and s[i - 1] == 'v':
		BEFORE += 1
		ANS += OCOUNT
	if s[i] == 'o':
		OCOUNT += BEFORE
print(ANS)


from itertools import accumulate
v = ord('v')
o = ord('o')
S = [o] + [ord(s) for s in input().strip()]
stack = []
pre = None
cnt = 0
for s in S:
	if s == pre:
		cnt += 1
	else:
		pre = s
		stack.append(cnt)
		cnt = 1
stack.append(cnt)
stack = stack[1:]
LS = len(stack)
w = 0
sp = [stack[i] - 1 if i % 2 else 0 for i in range(LS)]
sr = list(accumulate(sp))
sl = list(accumulate(sp[::-1]))[::-1]
ans = 0
for i in range(0, LS, 2):
	ans += sr[i] * sl[i] * stack[i]
print(ans)


import sys

class BWOWFactor:

	def solve(self):
		s = input()
		n = len(s)
		vv_pre = [0] * (n + 1)
		vv_suf = [0] * (n + 1)
		for i in range(n - 1):
			vv_pre[i + 1] = vv_pre[i]
			if s[i] == s[i + 1] == 'v':
				vv_pre[i + 1] += 1
		for i in range(n - 1, 0, -1):
			vv_suf[i - 1] = vv_suf[i]
			if s[i] == s[i - 1] == 'v':
				vv_suf[i - 1] += 1
		ans = 0
		for i in range(2, n - 2):
			if s[i] == 'o':
				ans += vv_pre[i - 1] * vv_suf[i + 1]
		print(ans)
solver = BWOWFactor()
input = sys.stdin.readline
solver.solve()


s = input()
os = []
for i in range(len(s)):
	if s[i] == 'o':
		os.append(i)
w = [0]
res = 0
for idx in range(len(s)):
	if idx >= 1:
		if s[idx] == 'v' and s[idx - 1] == 'v':
			w.append(w[idx - 1] + 1)
		else:
			w.append(w[idx - 1])
last = w[-1]
for j in os:
	res += w[j] * (last - w[j])
print(res)


import sys
for line in sys.stdin:
	ws = 0
	wos = 0
	wows = 0
	lastv = False
	for c in line:
		if c == 'v' and lastv:
			ws += 1
			wows += wos
		if c == 'v' and (not lastv):
			lastv = True
		if c == 'o':
			wos += ws
			lastv = False
	print(wows)
	break


s = input()
s = s.strip('o')
v = []
o = []
cnt_v = 0
cnt_o = 0
for i in range(len(s)):
	if s[i] == 'v':
		if cnt_o:
			o.append(cnt_o)
			cnt_o = 0
		cnt_v += 1
	else:
		if cnt_v:
			v.append(cnt_v)
			cnt_v = 0
		cnt_o += 1
v.append(cnt_v)
left = v[0]
left_cnt = 1
ans = 0
all_v = sum(v)
len_v = len(v)
for i in range(len(o)):
	ans += (left - left_cnt) * o[i] * (all_v - left - len_v + left_cnt)
	left += v[i + 1]
	left_cnt += 1
print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
s = input()
o = 0
w = 0
ans = 0
s1 = ''
c = 0
for i in range(len(s)):
	if s[i] == 'v':
		c += 1
	else:
		s1 += 'w' * (c - 1)
		c = 0
		s1 += s[i]
s1 += 'w' * (c - 1)
for i in range(len(s1)):
	if s1[i] == 'w':
		w += 1
		ans += o
	else:
		o += w
print(ans)


import sys

def main():
	str = sys.stdin.readline()
	vvBefore = [0] * len(str)
	vvAfter = [0] * len(str)
	for index in range(1, len(str)):
		vvBefore[index] = vvBefore[index - 1]
		if str[index] == 'v' and str[index - 1] == 'v':
			vvBefore[index] += 1
	for index in range(len(str) - 2, -1, -1):
		vvAfter[index] = vvAfter[index + 1]
		if str[index] == 'v' and str[index + 1] == 'v':
			vvAfter[index] += 1
	total = 0
	for i in range(len(str)):
		if str[i] == 'o':
			total += vvBefore[i] * vvAfter[i]
	print(total)
main()


a = input()
n = len(a)
c1 = 0
c2 = 0
ans = 0
for i in range(n - 1):
	if a[i] == 'v' and a[i + 1] == 'v':
		c1 += 1
for j in range(n - 1):
	if a[j] == 'v' and a[j + 1] == 'v':
		c2 += 1
	elif a[j] == 'o':
		ans += c2 * (c1 - c2)
print(ans)


s = input()
last = ''
count = 0
simplified = []
for x in s:
	if x == last:
		count += 1
	else:
		if last == 'v':
			if count >= 2:
				simplified.append(('w', count - 1))
		else:
			simplified.append(('o', count))
		count = 1
		last = x
if last == 'v' and count >= 2:
	if count >= 2:
		simplified.append(('w', count - 1))
else:
	simplified.append(('o', count))
simplified = simplified[1:]
wow_factor = 0
w_before = 0
w_after = sum(map(lambda x: x[1] if x[0] == 'w' else 0, simplified))
for (i, (let, count)) in enumerate(simplified):
	if let == 'w':
		w_before += count
		w_after -= count
	else:
		wow_factor += w_before * w_after * count
print(wow_factor)


st = list(input())
gc = 0
gcs = []
sgc = 0
voc = 0
for i in st:
	if i == 'v':
		if voc > 0:
			gc += 1
		voc += 1
	elif i == 'o':
		if gc > 0:
			gcs.append(gc)
		voc = 0
s = 0
for i in gcs:
	s += i * (gc - i)
print(s)


def main():
	s = input()
	o_count = 0
	v_count = 0
	dp = []
	curr = s[0]
	count = 0
	for i in s:
		if i == curr:
			count += 1
		else:
			if curr == 'v':
				if count > 1:
					dp.append(('v', count - 1))
			else:
				dp.append(('o', count))
			curr = i
			count = 1
	if curr == 'v':
		if count > 1:
			dp.append(('v', count - 1))
	else:
		dp.append(('o', count))
	while dp and dp[0][0] == 'o':
		dp.pop(0)
	while dp and dp[-1][0] == 'o':
		dp.pop()
	total = 0
	for i in dp:
		if i[0] == 'v':
			total += i[1]
	ans = 0
	count = 0
	for i in dp:
		if i[0] == 'v':
			total -= i[1]
			count += i[1]
		else:
			ans += count * total * i[1]
	print(ans)
main()


sre = input()
dfpdfd = []
plotttt = 0
edrftg = 0
for i in range(len(sre)):
	if sre[i] == 'v':
		plotttt += 1
	else:
		if plotttt > 0:
			dfpdfd.append(plotttt - 1)
		plotttt = 0
	if sre[i] == 'o':
		edrftg += 1
	else:
		if edrftg != 0:
			dfpdfd.append(edrftg)
		edrftg = 0
if edrftg > 0:
	dfpdfd.append(edrftg)
if plotttt > 0:
	dfpdfd.append(plotttt - 1)
dre = len(dfpdfd)
if sre[0] == 'v':
	cvbnrm = 0
	i = 0
	nbvhfh = 0
	while i < dre:
		nbvhfh += dfpdfd[i]
		i += 2
	i = 1
	nbvhfhp = 0
	while i < dre:
		nbvhfh -= dfpdfd[i - 1]
		nbvhfhp += dfpdfd[i - 1]
		cvbnrm += nbvhfhp * dfpdfd[i] * nbvhfh
		i += 2
	print(cvbnrm)
else:
	cvbnrm = 0
	i = 1
	nbvhfh = 0
	while i < dre:
		nbvhfh += dfpdfd[i]
		i += 2
	i = 2
	nbvhfhp = 0
	while i < dre:
		nbvhfh -= dfpdfd[i - 1]
		nbvhfhp += dfpdfd[i - 1]
		cvbnrm += nbvhfhp * dfpdfd[i] * nbvhfh
		i += 2
	print(cvbnrm)


s = str(input())
n = len(s)
cnt_w = 0
ans = 0
for i in range(n - 1):
	if s[i] == s[i + 1] == 'v':
		cnt_w += 1
cur_w = 0
for i in range(n - 1):
	if s[i] == s[i + 1] == 'v':
		cur_w += 1
	elif s[i] == 'o':
		ans += cur_w * (cnt_w - cur_w)
print(ans)


a = input().strip()
b = 'wow'
n = len(a)
m = len(b)
dp = [[0 for _ in range(m + 1)] for _ in range(n + 1)]
for i in range(n + 1):
	dp[i][m] = 1
for i in range(n - 1, -1, -1):
	for j in range(m - 1, -1, -1):
		c = 0
		if b[j] == 'w':
			if i + 1 < n and a[i] == 'v' and (a[i + 1] == 'v'):
				c += dp[i + 2][j + 1]
		elif a[i] == b[j]:
			c += dp[i + 1][j + 1]
		c += dp[i + 1][j]
		dp[i][j] = c
print(dp[0][0])


n = input()
ans = 0
nach = 0
nacho = 0
for i in range(len(n) - 1):
	if n[i] == n[i + 1] == 'v':
		nach += 1
		ans += nacho
	elif n[i] == 'o':
		nacho += nach
print(ans)


from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))

def solve():
	s = input()
	vv = 0
	vvo = 0
	answer = 0
	for i in range(1, len(s)):
		if s[i - 1:i + 1] == 'vv':
			answer += vvo
			vv += 1
		elif s[i] == 'o':
			vvo += vv
	print(answer)
mode = 's'
if mode == 'T':
	t = ri()
	for i in range(t):
		solve()
else:
	solve()


a = input()
n = len(a)
(v, k, s) = (0, 0, 0)
l = []
l.append(0)
for i in range(n - 1):
	if a[i] == 'v' and a[i + 1] == 'v':
		v += 1
	if a[i] == 'o':
		k += 1
		if v == s:
			l.append(v)
		else:
			l.append(v + l[k - 1])
	s = v
l.append(v)
s = 0
m = l[k + 1]
for i in range(1, k + 1):
	s += l[i] * (m - l[i])
print(s)


s = input()
n = len(s)
prev = 'o'
count = 0
prefix = [0 for i in range(n + 1)]
ind = 1
for i in s:
	if i == 'v':
		if prev == 'v':
			count += 1
		else:
			count = 1
	else:
		count = 0
	prev = i
	if count >= 2:
		prefix[ind] = prefix[ind - 1] + 1
	else:
		prefix[ind] = prefix[ind - 1]
	ind += 1
ans = 0
ind = 1
for i in s:
	if i == 'o':
		ans += prefix[ind] * (prefix[-1] - prefix[ind])
	ind += 1
print(ans)


import sys
import math
from collections import defaultdict
s = input()
l = len(s)
a = []
t = 0
for i in range(len(s)):
	if i < l - 1 and s[i] == 'v' and (s[i + 1] == 'v'):
		t += 1
	if s[i] == 'o':
		a.append(t)
if s[l - 1] != 'o':
	a.append(t)
l1 = len(a)
c = 0
for i in range(l1 - 1):
	c += a[i] * (a[l1 - 1] - a[i])
print(c)


s = input()
a = [0]
for (x, y) in zip(s, s[1:]):
	a += (a[-1] + (x + y > 'vo'),)
print(sum((x * (a[-1] - y) * (z < 'v') for (x, y, z) in zip(a, a[1:], s))))


import math
from decimal import *
import random
mod = int(1000000000.0) + 7
s = str(input())
dp = []
n = len(s)
(a, b, c) = (0, 0, 0)
for i in range(n):
	if s[i] == 'o':
		b += a
	if i > 0:
		if s[i] == s[i - 1] == 'v':
			a += 1
			c += b
print(c)


s = input().strip('o')
ans = 0
wcnt = 0
mem = 0
fst = True
prevv = True
for i in range(1, len(s)):
	if s[i] == 'v':
		if prevv:
			wcnt += 1
			if not fst:
				ans += mem
		else:
			prevv = True
	else:
		fst = False
		prevv = False
		mem += wcnt
print(ans)


from sys import stdin
input = lambda : stdin.readline()
from math import ceil, sqrt, gcd
s = input().strip()
l = [0 for i in range(len(s))]
count = 0
for i in range(len(s) - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		l[i + 1] = l[i] + 1
	else:
		l[i + 1] = l[i]
for i in range(1, len(s) - 1):
	if s[i] == 'o':
		count += l[i - 1] * (l[len(s) - 1] - l[i + 1])
print(count)


vstr = input()
wstr = []
for i in range(len(vstr) - 1):
	if vstr[i] == 'v' and vstr[i + 1] == 'v':
		wstr.append('w')
	elif vstr[i] == 'o':
		wstr.append('o')
wfact = 0
subs = 'wow'
table = []
(n, m) = (len(wstr) + 1, len(subs) + 1)
for _ in range(n):
	table.append([0] * m)

def filltab(iseq, isubseq, seq, subseq):
	if iseq == 0:
		return 0
	elif isubseq == 0:
		return 1
	return table[iseq - 1][isubseq] + (table[iseq - 1][isubseq - 1] if seq[n - iseq - 1] == subseq[m - isubseq - 1] else 0)
for r in range(n):
	for c in range(m):
		if r == 0 and c == 0:
			table[r][c] = 1
		else:
			table[r][c] = filltab(r, c, wstr, subs)
print(table[n - 1][m - 1])


s = input()
merge = []
count_v = 0
for char in s:
	if char == 'v':
		count_v += 1
	else:
		merge.append(max(count_v - 1, 0))
		count_v = 0
merge.append(max(count_v - 1, 0))
res = 0
left = 0
left_sum = 0
for i in merge:
	res += left * i
	left_sum += i
	left += left_sum
print(res)


s = input()
w = o = total = 0
for i in range(len(s)):
	if s[i] == 'o':
		o += w
	elif i > 0 and s[i - 1] == 'v':
		w += 1
		total += o
print(total)


import math
import collections
import bisect

def arrPrint(a):
	return ' '.join([str(i) for i in a])

def gridPrint(a):
	return '\n'.join([' '.join([str(j) for j in a[i]]) for i in range(len(a))])

def isPalindrome(s):
	for i in range(len(s) // 2):
		if not s[i] == s[-i - 1]:
			return False
	return True

def primeCheck(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True

def solve(s):
	ans = 0
	w = prevW = ans = 0
	for i in range(len(s)):
		if s[i] == 'o':
			prevW += w
		elif i > 0 and s[i - 1] == 'v':
			w += 1
			ans += prevW
	return ans
s = input()
print(solve(s))


def count(a, b):
	m = len(a)
	n = len(b)
	lookup = [[0] * (n + 1) for i in range(m + 1)]
	for i in range(n + 1):
		lookup[0][i] = 0
	for i in range(m + 1):
		lookup[i][0] = 1
	for i in range(1, m + 1):
		for j in range(1, n + 1):
			if a[i - 1] == b[j - 1]:
				lookup[i][j] = lookup[i - 1][j - 1] + lookup[i - 1][j]
			else:
				lookup[i][j] = lookup[i - 1][j]
	return lookup[m][n]
s = input()
l = []
for i in range(1, len(s)):
	if s[i] == 'v' and s[i - 1] == 'v':
		l.append('w')
	if s[i] == 'o':
		l.append('o')
print(count(''.join(l), 'wow'))


s = input()
n = len(s)
V = [0] * (n + 1)
w = 0
for i in range(n):
	if s[i] == 'v':
		if w == 1:
			V[i + 1] = V[i] + 1
		else:
			V[i + 1] = V[i]
			w = 1
	else:
		V[i + 1] = V[i]
		w = 0
nn = V[n]
ans = 0
for i in range(n):
	if s[i] == 'o':
		(n1, n2) = (nn - V[i], V[i])
		ans += n1 * n2
print(ans)


S = input()
X = [0, 0, 0]
for i in range(len(S)):
	if i and S[i - 1:i + 1] == 'vv':
		X[2] += X[1]
		X[0] += 1
	elif S[i] == 'o':
		X[1] += X[0]
print(X[2])


s = input()
prev = 'a'
arr = []
arr2 = []
count = 0
for char in s:
	if char == 'v' and prev == 'v':
		count += 1
	elif char == 'o':
		arr.append(count)
		prev = 'o'
	else:
		prev = 'v'
news = s[:len(s) - 1]
prev = 'a'
count = 0
for char in reversed(s):
	if char == 'o':
		arr2.append(count)
		prev = 'o'
	elif prev == 'v' and char == 'v':
		count += 1
	else:
		prev = 'v'
newarr = arr2[::-1]
ans = 0
for i in range(len(newarr)):
	ans += arr[i] * newarr[i]
print(ans)


s = input()
n = len(s)
count_o = []
count_w = 0
count = 0
for i in range(1, n):
	if s[i] == 'v' and s[i - 1] == 'v':
		count_w += 1
	elif s[i] == 'o':
		count_o.append(count_w)
for c in count_o:
	count += c * (count_w - c)
print(count)


s = input()
dp = [0] * 4
for i in range(1, len(s)):
	if s[i - 1:i + 1] == 'vv':
		dp[0] += 1
		dp[2] += dp[1]
	elif s[i] == 'o':
		dp[1] += dp[0]
print(dp[2])


s = input()
l = len(s)
a = [0] * l
t = 0
c = 0
for i in range(l):
	if s[i] == 'v':
		t += 1
	else:
		c += max(t - 1, 0)
		t = 0
		a[i] = c
c = 0
t = 0
ans = 0
for i in range(l - 1, -1, -1):
	if s[i] == 'v':
		t += 1
	else:
		c += max(t - 1, 0)
		t = 0
		ans += a[i] * c
print(ans)


from sys import stdin, stdout, exit
s = stdin.readline().rstrip()
l1 = []
l2 = []
a = 0
if len(s) < 5:
	stdout.write(str(0))
	exit()
for i in range(len(s)):
	if s[i] == 'v':
		a += 1
	else:
		if a != 0:
			a = a - 1
		if len(l1) != 0:
			a += l1[len(l1) - 1]
		l1.append(a)
		a = 0
a = 0
for i in range(len(s) - 1, -1, -1):
	if s[i] == 'v':
		a += 1
	else:
		if a != 0:
			a = a - 1
		if len(l2) != 0:
			a += l2[len(l2) - 1]
		l2.append(a)
		a = 0
l2.reverse()
q = 0
if max(l1) == 0 or max(l2) == 0:
	stdout.write(str(0))
else:
	for i in range(len(l1)):
		q += l1[i] * l2[i]
	stdout.write(str(q))


s = input()
n = len(s)
s1 = ''
(i, j) = (0, 0)
for i in range(n):
	if s[i] == 'v':
		break
for j in range(n):
	if s[n - j - 1] == 'v':
		break
s = s[i:n - j]
n = len(s)
arr = []
last = s[0]
h = 1
if len(s) < 3:
	print(0)
else:
	for i in range(1, n):
		if s[i] == last:
			h += 1
		else:
			last = s[i]
			arr.append(h)
			h = 1
	arr.append(h)
	n = len(arr)
	for i in range(0, n, 2):
		arr[i] -= 1
	(v, vo, vov) = (0, 0, 0)
	for i in range(n):
		if i % 2 == 0:
			v += arr[i]
			vov += vo * arr[i]
		else:
			vo += v * arr[i]
	print(vov)


input_string = input()
count_w = 0
max_w = 0
dp = [0]
index = 0
for i in range(0, len(input_string) - 1):
	if input_string[i] == 'v' and input_string[i + 1] == 'v':
		count_w += 1
		max_w += 1
	if input_string[i] == 'o':
		dp.append(dp[index] + count_w)
		index += 1
		count_w = 0
res = 0
for i in range(0, len(dp)):
	res += dp[i] * (max_w - dp[i])
print(res)


st = input()
n = len(st)
if n < 5:
	print(0)
	exit()
i = 0
while i < n and (not (st[i] == 'v' and st[i + 1] == 'v')):
	i += 1
if n == i:
	print(0)
	exit()
st += 'oo' if st[n - 1] == 'v' else 'vv'
lv = lo = 0
l = []
p = 'o'
for i in range(i, n + 1):
	if st[i] == 'v':
		if p == 'o':
			if lo > 0 and st[i + 1] == 'v':
				l.append(lo)
				lo = 0
		lv += 1
		p = 'v'
	else:
		if p == 'v':
			if lv > 1:
				l.append(lv - 1)
			lv = 0
		lo += 1
		p = 'o'
ll = len(l)
sow = ans = nw = 0
for i in range(0, ll):
	if i % 2:
		sow += l[i] * nw
	else:
		ans += l[i] * sow
		nw += l[i]
print(ans)


l = list(input())
num = 0
n = len(l)
arr = [0] * n
for i in range(n):
	if l[i] == 'v':
		arr[i] = num
		num = 1
	else:
		num = 0
for i in range(1, n):
	arr[i] += arr[i - 1]
result = 0
for i in range(1, n - 1):
	if l[i] == 'o':
		result += (arr[n - 1] - arr[i + 1]) * arr[i - 1]
print(result)


s = input()
ans = 0
pre = 0
suf = 0
for i in range(len(s) - 1, 0, -1):
	if s[i] == 'v' and s[i - 1] == 'v':
		suf += 1
for i in range(len(s) - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		pre += 1
		suf -= 1
	elif s[i] == 'o':
		ans += pre * suf
print(ans)


import sys
s = sys.stdin.readline().strip()
n = len(s)
w = 0
wo = 0
wow = 0
for i in range(1, n):
	if s[i] == 'v' and s[i - 1] == 'v':
		w = w + 1
		wow = wow + wo
	if s[i] == 'o':
		wo = wo + w
print(wow)


s = input()
w = 0
wow = 0
wo = 0
for i in range(1, len(s)):
	if s[i] == 'v' and s[i - 1] == 'v':
		w += 1
		wow += wo
		continue
	if s[i] == 'o':
		wo += w
print(wow)


def solve(s):
	n = len(s)
	dpb = [0] * n
	dpa = [0] * n
	for i in range(n - 1):
		dpb[i + 1] = dpb[i] + (1 if s[i] == 'v' and s[i + 1] == 'v' else 0)
	for i in range(n - 2, -1, -1):
		dpa[i] = dpa[i + 1] + (1 if s[i] == 'v' and s[i + 1] == 'v' else 0)
	res = 0
	for i in range(n):
		if s[i] == 'o':
			res += dpa[i] * dpb[i]
	return res
s = input()
print(solve(s))


s = input()
v = 0
o = 0
S = []
totalv = 0
for i in range(len(s)):
	if s[i] == 'v':
		v += 1
		if o and v > 1:
			S.append(('o', o))
			o = 0
	if s[i] == 'o':
		o += 1
		if v:
			if v > 1:
				totalv += v - 1
				S.append(('v', v - 1))
			v = 0
if v:
	totalv += v - 1
	S.append(('v', v - 1))
l = []
r = []
o = []
x = 0
ans = 0
if len(S) >= 3:
	for i in S:
		if i[0] == 'v':
			x += i[1]
		if i[0] == 'o':
			ans += x * (totalv - x) * i[1]
print(ans)


import sys
from math import ceil
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

def input():
	return fast_reader().strip()

def list_input():
	return list(map(int, input().split()))

def sep_input():
	return map(int, input().split())
s = input()
n = len(s)
l = []
for i in range(n - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		l.append(1)
	else:
		l.append(0)
l.append(0)
c = 0
pref = []
for i in range(n):
	c += l[i]
	pref.append(c)
ans = 0
for i in range(n):
	if s[i] == 'o':
		t1 = pref[i]
		t2 = pref[-1] - pref[i]
		ans += t1 * t2
print(ans)


import time
string = input()

def find_w_count(start, end):
	count = 0
	for i in range(start, end):
		if string[i:i + 2] == 'vv':
			count += 1
	return count
total_wows = 0
(wows_left, wows_right) = (0, 0)
o_started = 0
v_s = 0
for i in range(2, len(string) - 2):
	if string[i] == 'o' and o_started == 0:
		wows_left = find_w_count(0, i - 1)
		wows_right = find_w_count(i + 1, len(string))
		total_wows = total_wows + wows_left * wows_right
		o_started = 1
	elif o_started == 1 and string[i] == 'v' and (string[i - 1] == 'v'):
		v_s += 1
	elif o_started == 1 and string[i] == 'o':
		wows_left += v_s
		wows_right -= v_s
		total_wows = total_wows + wows_left * wows_right
		v_s = 0
print(total_wows)


s = input()
a = []
b = []
(c, d, m) = (0, 0, 0)
d = 0
for i in range(len(s) - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		c += 1
	elif s[i] == 'o':
		a.append(c)
for i in range(len(s) - 1, -1, -1):
	if s[i] == 'v' and s[i - 1] == 'v':
		d += 1
	elif s[i] == 'o':
		b.append(d)
b = b[::-1]
for i in range(len(a)):
	m += a[i] * b[i]
print(m)


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	s = str(input())
	cnt = 0
	temp = 0
	for i in range(len(s)):
		if s[i] == 'v':
			temp += 1
		else:
			cnt += max(0, temp - 1)
			temp = 0
	cnt += max(0, temp - 1)
	ans = 0
	v = 0
	t = 0
	for i in range(len(s)):
		if s[i] == 'o':
			t += max(v - 1, 0)
			ans += (cnt - t) * t
			v = 0
		else:
			v += 1
	print(ans)
main()


import sys
s = sys.stdin.readline()
w = 0
p = 'a'
for u in s:
	if u == 'v' and p == 'v':
		w += 1
	p = u
cw = 0
p = 'a'
r = 0
for u in s:
	if u == 'v' and p == 'v':
		cw += 1
	elif u == 'o':
		r += cw * (w - cw)
	p = u
print(r)


s = input()
l = []
w = ''
co = sum = 0
t = s
s = s + '0'
for (i, w) in enumerate(t):
	if s[i] == s[i + 1] and w == 'v':
		co += 1
		continue
	if w == 'o':
		co = 0
		l.append(w)
	elif co > 0:
		sum += co
		l.append(co)
(ans, w) = (0, 0)
for x in l:
	if x == 'o':
		ans += sum * w
	if type(x) == int:
		w += x
		sum -= x
print(ans)


s = input()
s += 'o'
index = 0
while index < len(s) and s[index] == 'o':
	index += 1
a = []
count_o = []
count_v = []
cur_o = 0
cur_v = 0
while index < len(s):
	if s[index] == 'o':
		if cur_o == 0:
			count_v.append(max(0, cur_v - 1))
			cur_v = 0
			cur_o = 1
		else:
			cur_o += 1
	elif cur_v == 0:
		count_o.append(cur_o)
		cur_o = 0
		cur_v = 1
	else:
		cur_v += 1
	index += 1
if len(count_v) < 2:
	print(0)
else:
	res = 0
	left = count_v[0]
	right = sum(count_v) - left
	for i in range(1, len(count_o)):
		res += left * right * count_o[i]
		left += count_v[i]
		right -= count_v[i]
	print(res)


s = input()
n = len(s)
w = n * [0]
ow = n * [0]
wow = n * [0]
w[n - 1] = 0
for i in range(n - 2, -1, -1):
	w[i] = w[i + 1]
	if s[i] == 'v' and s[i + 1] == 'v':
		w[i] += 1
ow[n - 1] = 0
for i in range(n - 2, -1, -1):
	ow[i] = ow[i + 1]
	if s[i] == 'o':
		ow[i] += w[i]
wow[n - 1] = 0
for i in range(n - 2, -1, -1):
	wow[i] = wow[i + 1]
	if s[i] == 'v' and s[i + 1] == 'v':
		wow[i] += ow[i]
print(wow[0])


import math as mt
import sys, string, bisect
input = sys.stdin.readline
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
l = input().strip()
c = 0
left = []
right = []
for i in range(len(l) - 1):
	if l[i] == 'v' and l[i + 1] == 'v':
		c += 1
	if l[i] == 'o':
		left.append(c)
if l[-1] == 'o':
	left.append(c)
c = 0
for i in range(len(l) - 1, -1, -1):
	if l[i] == 'v' and l[i - 1] == 'v':
		c += 1
	if l[i] == 'o':
		right.append(c)
right.reverse()
ans = 0
for i in range(len(right)):
	ans += left[i] * right[i]
print(ans)


def solve():
	(ws, vs, ans, tem) = (0, -1, 0, 0)
	for i in range(len(s)):
		if s[i] == 'v':
			vs += 1
			if vs > 0 and ws > 0 and (i == len(s) - 1 or s[i + 1] == 'o'):
				ans += vs * tem
		else:
			if vs >= 1:
				ws += vs
			vs = -1
			tem += ws
	return ans
s = input()
print(solve())


s = input()
c = 0
n = len(s)
a = [0] * n
i = 0
while i < n:
	if s[i] == 'v':
		count = 0
		while i < n and s[i] == 'v':
			count += 1
			i += 1
		c += count - 1
	else:
		a[i] = c
		i += 1
ans = 0
for i in range(n):
	ans += a[i] * (c - a[i])
print(ans)


s = input() + 'o'
vcount = 0
wcount = 0
wocount = 0
wowcount = 0
for (i, ch) in enumerate(s):
	if ch == 'v':
		vcount += 1
	if ch == 'o':
		ws = max(vcount - 1, 0)
		wcount += ws
		wowcount += wocount * ws
		wocount += wcount
		vcount = 0
print(wowcount)


s = input()
b = []
ch = s[0]
co = 0
for i in s:
	if i == ch:
		co += 1
	else:
		b.append([ch, co])
		co = 1
		ch = i
b.append([ch, co])
for i in b:
	if i[0] == 'v':
		i[1] -= 1
tot = 0
for i in b:
	if i[0] == 'v':
		tot += i[1]
ans = 0
prev = 0
for i in b:
	if i[0] == 'o':
		ans += prev * tot * i[1]
	else:
		prev += i[1]
		tot -= i[1]
print(ans)


a = ''
b = 0
s = input()
for i in range(len(s) - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		a += 'w'
		b += 1
	elif s[i] == 'o':
		a += 'o'
c = 0
ans = 0
for j in range(len(a)):
	if a[j] == 'w':
		c += 1
	elif a[j] == 'o':
		ans += (b - c) * c
print(ans)


from collections import Counter
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
mod = int(1000000000.0) + 7
s = input()
i = 0
n = len(s)
ans = 0
till = 0
v = 0
for i in range(1, n):
	if s[i] == 'v' and s[i - 1] == 'v':
		v += 1
		ans += till
	elif s[i] == 'o':
		till += v
print(ans)


string = input()
front = [0]
back = [0]
for i in range(1, len(string)):
	if string[i] == string[i - 1] == 'v':
		front.append(front[-1] + 1)
	else:
		front.append(front[-1])
for i in range(1, len(string)):
	if string[len(string) - i] == string[len(string) - i - 1] == 'v':
		back.append(back[-1] + 1)
	else:
		back.append(back[-1])
ans = 0
for i in range(len(string)):
	if string[i] == 'o':
		ans = ans + back[len(string) - 1 - i] * front[i]
print(ans)


s = input().split()[0]
wos = []
sum_w = 0
sum_o = 0
for i in range(len(s)):
	if s[i] == 'o':
		wos.append(sum_w + (0 if len(wos) == 0 else wos[-1]))
		sum_o += 1
	elif s[i] == 'v':
		wos.append(0 if len(wos) == 0 else wos[-1])
		if i == 0 or s[i - 1] != 'v':
			pass
		else:
			sum_w += 1
answer = 0
for i in range(len(s)):
	if s[i] == 'o':
		pass
	elif s[i] == 'v':
		if i == 0 or s[i - 1] != 'v':
			pass
		else:
			answer += wos[i]
print(answer)


import sys
import math
s = input()
count = 0
if s[0] == 'o':
	count = 0
else:
	count = 1
pre = [0]
for i in range(1, len(s)):
	if s[i] == 'v' and count > 0:
		pre.append(pre[-1] + 1)
		count += 1
	elif s[i] == 'v' and count == 0:
		pre.append(pre[i - 1])
		count = 1
	else:
		pre.append(pre[i - 1])
		count = 0
ans = 0
for i in range(len(s)):
	if s[i] == 'o':
		ans += pre[i] * (pre[-1] - pre[i])
print(ans)


s = input()
n = len(s)
g = []
ind = -1
for i in range(n - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		ind = i
		break
if ind == -1:
	print(0)
	exit()
count = 1
for i in range(ind + 1, n):
	if s[i] == s[i - 1]:
		count += 1
	else:
		if count == 1 and s[i] == 'o':
			count = g.pop() + 1
			continue
		g.append(count)
		count = 1
g.append(count)
c = 0
for i in range(0, len(g), 2):
	g[i] -= 1
	c += g[i]
suff = [c]
pref = [g[0]]
for i in range(1, len(g)):
	if i % 2:
		suff.append(suff[-1] - g[i - 1])
		pref.append(pref[-1])
	else:
		suff.append(suff[-1])
		pref.append(pref[-1] + g[i])
ans = 0
for i in range(1, len(g), 2):
	ans += g[i] * pref[i] * suff[i]
print(ans)


string = input()
m = len(string)
countWs = 0
countWsThisTime = -1
multiplier = 0
numOs = 0
ans = 0
for i in range(m):
	if string[i] == 'o':
		a = max(countWsThisTime, 0)
		ans += a * multiplier
		countWs += a
		multiplier += countWs
		numOs += 1
		countWsThisTime = -1
	else:
		countWsThisTime += 1
ans += max(countWsThisTime, 0) * multiplier
print(ans)


import sys
import os.path
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
s = input()
n = len(s)
ans = 0
wCount = 0
tot = 0
for i in range(n - 1):
	if s[i] == 'o':
		tot += wCount
	elif s[i] == 'v' and s[i + 1] == 'v':
		wCount += 1
		ans += tot
print(ans)


z = input()
x = 0
y = 0
w = 0
for i in range(len(z)):
	if z[i] == 'o':
		y += x
	elif i != 0:
		if z[i - 1] == 'v':
			x += 1
			w += y
print(w)


s = input()
dp = [0] * len(s)
for i in range(1, len(s)):
	if s[i - 1] == 'v' and s[i] == 'v':
		dp[i] = dp[i - 1] + 1
	elif s[i] == 'o' or s[i - 1] == 'o':
		dp[i] = dp[i - 1]
answer = 0
for i in range(len(s)):
	if s[i] == 'o':
		answer = answer + dp[i] * (dp[len(s) - 1] - dp[i])
print(answer)


import sys
import re
input = sys.stdin.readline

def count(a, b):
	m = len(a)
	n = len(b)
	lookup = [[0] * (n + 1) for i in range(m + 1)]
	for i in range(n + 1):
		lookup[0][i] = 0
	for i in range(m + 1):
		lookup[i][0] = 1
	for i in range(1, m + 1):
		for j in range(1, n + 1):
			if a[i - 1] == b[j - 1]:
				lookup[i][j] = lookup[i - 1][j - 1] + lookup[i - 1][j]
			else:
				lookup[i][j] = lookup[i - 1][j]
	return lookup[m][n]
s = input().strip()
arr = [m.group(0) for m in re.finditer('([a-z])\\1*', s)]
new = []
for ele in arr:
	if ele[0] == 'v':
		new.append('w' * (len(ele) - 1))
	else:
		new.append(''.join(ele))
new = ''.join(new)
print(count(new, 'wow'))


s = input()
w_counter = 0
o_list = []
for i in range(1, len(s)):
	if s[i] == 'v' and s[i - 1] == 'v':
		w_counter += 1
	elif s[i] == 'o':
		o_list.append(w_counter)
ans = 0
for i in o_list:
	ans += i * (w_counter - i)
print(ans)


s = input()
pre = [0]
curr = -1
n = len(s)
for i in range(1, n):
	if s[i] == 'v' and s[i - 1] == 'v':
		pre.append(pre[-1] + 1)
	else:
		pre.append(pre[-1])
curr = 0
ans = 0
for i in range(n - 2, -1, -1):
	if s[i] == 'v' and s[i + 1] == 'v':
		curr += 1
	elif s[i] == 'o':
		ans += curr * pre[i]
print(ans)


s = input()
n = len(s)
w = 0
wcount = []
for i in range(1, n):
	if s[i] == 'v' and s[i - 1] == 'v':
		w += 1
	elif s[i] == 'o':
		wcount.append(w)
ans = 0
for i in wcount:
	ans += i * (w - i)
print(ans)


str = input()
start = len(str) - 1
k_w = 0
k_do = 0
sum_wow = 0
for i in range(0, len(str) - 1):
	if str[i] == 'v' and str[i + 1] == 'v':
		k_w += 1
for i in range(0, len(str) - 1):
	if str[i] == 'v' and str[i + 1] == 'v':
		k_do += 1
		k_w -= 1
	if str[i] == 'o':
		sum_wow += k_do * k_w
print(sum_wow)


wow = input()
a = []
i = 0
while i < len(wow) and wow[i] == 'o':
	i += 1
while i < len(wow):
	w = -1
	while i < len(wow) and wow[i] == 'v':
		w += 1
		i += 1
	a.append(w)
	o = 0
	while i < len(wow) and wow[i] == 'o':
		o += 1
		i += 1
	a.append(o)
if len(a) % 2 == 0:
	a = a[:-1]
(x, y, z) = (0, 0, 0)
for i in range((len(a) - 1) // 2):
	x += a[2 * i]
	y += x * a[2 * i + 1]
	z += y * a[2 * i + 2]
print(z)


lis = list(input())
a_0 = 0
a_1 = 0
result = 0
for i in range(len(lis)):
	if i < len(lis) - 1 and lis[i] == 'v' and (lis[i + 1] == 'v'):
		a_0 += 1
		result += a_1
	elif lis[i] == 'o':
		a_1 += a_0
print(result)


s = input()
allw = 0
for i in range(len(s) - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		allw += 1
tecw = 0
count = 0
for i in range(len(s) - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		tecw += 1
	if s[i] == 'o':
		count += tecw * (allw - tecw)
print(count)


s = input()
n = len(s)
first = [0] * n
last = [0] * n
p = 0
c = 0
for i in range(n):
	if s[i] == 'v':
		p += 1
	else:
		if p:
			c += p - 1
		p = 0
	if s[i] == 'o':
		first[i] = c
p = 0
c = 0
for i in range(n - 1, -1, -1):
	if s[i] == 'v':
		p += 1
	else:
		if p:
			c += p - 1
		p = 0
	if s[i] == 'o':
		last[i] = c
result = 0
for i in range(n):
	if s[i] == 'o':
		result += first[i] * last[i]
print(result)


s = input()
l = []
c = 0
for i in s:
	if i == 'v':
		c += 1
	else:
		l.append(max(0, c - 1))
		c = 0
if c != 0:
	l.append(max(0, c - 1))
a = 0
b = sum(l)
r = 0
for i in l:
	a += i
	b -= i
	r += a * b
print(r)


import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000)

def getN():
	return int(input())

def getList():
	return list(map(int, input().split()))
import math
s = input().strip()
org = ''
suc = 'a'
for c in s:
	if c == 'o':
		org += 'o'
		suc = 'o'
	else:
		if suc == 'v':
			org += 'w'
		suc = 'v'
nw = 0
nwo = 0
ans = 0
for c in org:
	if c == 'w':
		nw += 1
		ans += nwo
	else:
		nwo += nw
print(ans)


from sys import stdin
from bisect import bisect_right
inp = lambda : stdin.readline().strip()
s = list(inp())
o = 0
w = 0
ans = 0
for i in range(len(s)):
	if s[i] == 'o':
		o += w
	elif i > 0 and s[i - 1] == 'v':
		w += 1
		ans += o
print(ans)


s = input()
n = len(s)
v = [0, 0]
for i in range(1, n):
	if s[i - 1] == s[i] == 'v':
		v.append(v[-1] + 1)
	else:
		v.append(v[-1])
t = 0
for i in range(2, n - 2):
	if s[i] == 'o':
		prev = v[i]
		after = v[n] - v[i]
		t += prev * after
print(t)


s = input()
w_count = 0
wo_count = 0
wow_count = 0
for i in range(len(s)):
	if s[i] == 'o':
		wo_count += w_count
	elif i > 0 and s[i - 1] == 'v':
		w_count += 1
		wow_count += wo_count
print(wow_count)


s = str(input())
ans = 0
t = 0
count = 0
for i in range(len(s) - 1):
	if s[i] + s[i + 1] == 'vv':
		count = count + 1
for i in range(len(s) - 1):
	if s[i] + s[i + 1] == 'vv':
		t = t + 1
	if s[i] == 'o':
		if t > 0:
			ans = ans + t * (count - t)
print(ans)


a = input()
d = []
c = 0
sm = 0
l = len(a)
for i in range(l - 1):
	if a[i] == 'v' and a[i] == a[i + 1]:
		c += 1
	elif a[i] == 'o':
		d.append(c)
		sm += c
		c = 0
sm += c
ans = 0
s = 0
for i in d:
	s += i
	p = sm - s
	ans += p * s
print(ans)


l = input()
a = b = 0
wow = []
pre = 0
aft = 0
su = 0
for i in l:
	if i == 'v':
		a += 1
		if b:
			wow.append(-b)
			b = 0
	else:
		b += 1
		if a:
			aft += a - 1
			wow.append(a - 1)
			a = 0
if a:
	aft += a - 1
	wow.append(a - 1)
else:
	wow.append(-b)
for i in wow:
	if i > 0:
		pre += i
		aft -= i
	elif i < 0:
		su += pre * aft * -i
print(su)


ll = lambda : list(map(int, input().split()))
testcases = 1
for testcase in range(testcases):
	s = input()
	n = len(s)
	dp = [0]
	for i in range(n - 1):
		if s[i] == 'v' and s[i + 1] == 'v':
			dp.append(dp[-1] + 1)
		else:
			dp.append(dp[-1])
	ans = 0
	for i in range(0, n):
		if s[i] == 'o':
			ans += dp[i] * (dp[-1] - dp[i])
	print(ans)


def main(mot):
	o_idx = []
	w_left = [0] * len(mot)
	w_right = [0] * len(mot)
	w_tmp = 0
	for i in range(len(mot) - 1):
		if mot[i] == 'v':
			if mot[i + 1] == 'v':
				w_tmp += 1
		else:
			o_idx.append(i)
			w_left[i] = w_tmp
	w_tmp = 0
	for i in range(len(mot) - 1, 0, -1):
		if mot[i] == 'v':
			if mot[i - 1] == 'v':
				w_tmp += 1
		else:
			w_right[i] = w_tmp
	wow = 0
	for i in o_idx:
		wow += w_right[i] * w_left[i]
	return wow
print(main(input()))


v_tmp = 0
ans = 0
s = input().strip('o')
prev = 'v'
tmp = []
c = -1
for i in s:
	if i == prev:
		c += 1
	else:
		if len(tmp) > 1 and prev == 'v':
			tmp.append(c + tmp[-2])
		else:
			tmp.append(c)
		prev = i
		if prev == 'o':
			c = 1
		else:
			c = 0
if len(tmp) > 1 and prev == 'v':
	tmp.append(c + tmp[-2])
else:
	tmp.append(c)
for i in range(1, len(tmp), 2):
	ans += tmp[i] * tmp[i - 1] * (tmp[-1] - tmp[i - 1])
print(ans)


def solution2():
	s = input()
	w = o = count = 0
	l_s = len(s)
	for i in range(l_s):
		if s[i] == 'o':
			o += w
		elif i > 0 and s[i - 1] == 'v':
			w += 1
			count += o
	print(count)
solution2()


def sol():
	s = input()
	s = s.replace(' ', '')
	o = s.split('o')
	v = []
	for i in o:
		cc = 0
		if len(i) >= 2:
			cc = len(i) - 1
		else:
			cc = 0
		v.append(cc)
	c = 0
	su = sum(v)
	l = 0
	r = su
	for i in range(len(v) - 1):
		l = l + v[i]
		r = su - l
		c += l * r
	print(c)
sol()


from fractions import gcd
import math

def inverse(a):
	return pow(a, mod - 2, mod)

def usearch(x, a):
	lft = 0
	rgt = len(a) + 1
	while rgt - lft > 1:
		mid = (rgt + lft) // 2
		if a[mid] <= x:
			lft = mid
		else:
			rgt = mid
	return lft

def main():
	s = input()
	dp = [(0, 0)] * (len(s) + 1)
	index = 0
	l = 1
	for i in range(1, len(s)):
		if s[i - 1] == s[i]:
			l += 1
		else:
			if s[i - 1] == 'o':
				dp[index] = ('o', l)
			else:
				dp[index] = ('v', max([l - 1, 0]))
			index += 1
			l = 1
	dp[index] = ('v', max([l - 1, 0])) if s[-1] == 'v' else ('o', l)
	ans = 0
	wcum = 0
	wocum = 0
	for i in range(len(s) + 1):
		if dp[i][0] == 'v':
			ans += wocum * dp[i][1]
			wcum += dp[i][1]
		else:
			wocum += wcum * dp[i][1]
	print(ans)
main()


s = input()
pre = []
suff = []
j = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1] and s[i] != 'o':
		j += 1
	elif s[i] == 'o':
		pre.append(j)
if s[len(s) - 1] == 'o':
	pre.append(j)
j = 0
for i in range(len(s) - 1, 0, -1):
	if s[i] == s[i - 1] and s[i] != 'o':
		j += 1
	elif s[i] == 'o':
		suff.append(j)
if s[0] == 'o':
	suff.append(j)
suff.reverse()
ans = 0
for i in range(len(pre)):
	ans += pre[i] * suff[i]
print(ans)


from sys import stdin, stdout
s = stdin.readline().strip()
n = len(s)
wcount = [0] * n
for i in range(1, n):
	if s[i] == 'v' and s[i - 1] == 'v':
		wcount[i] = wcount[i - 1] + 1
	else:
		wcount[i] = wcount[i - 1]
ans = 0
for (i, char) in enumerate(s):
	if char == 'o':
		ans += wcount[i - 1] * (wcount[-1] - wcount[i - 1])
print(ans)


s = input()
ans = 0
wcnt = 0
mem = 0
for i in range(1, len(s)):
	if s[i] == s[i - 1] == 'v':
		wcnt += 1
		ans += mem
	elif s[i] == 'o':
		mem += wcnt
print(ans)


s = input()
oLoco = []
cnt = 0
for i in range(0, len(s) - 1):
	if s[i] == 'o':
		oLoco.append(cnt)
	elif s[i + 1] == 'v':
		cnt += 1
l = [(cnt - oLoco[i]) * oLoco[i] for i in range(len(oLoco))]
print(sum(l))


s = input()
wtot = 0
for i in range(1, len(s)):
	if s[i] == 'v' and s[i - 1] == 'v':
		wtot += 1
wleft = 0
ans = 0
for i in range(len(s)):
	if i > 0 and s[i] == 'v' and (s[i - 1] == 'v'):
		wleft += 1
	elif s[i] == 'o':
		ans += wleft * (wtot - wleft)
print(ans)


a = list(input())
q = 0
w = 0
qw = 0
for i in range(len(a)):
	if a[i] == 'o':
		w = w + q
	elif i > 0 and a[i - 1] == 'v':
		q = q + 1
		qw = qw + w
print(qw)


s = input()
n = len(s)
totalvv = 0
for i in range(1, n):
	if s[i - 1:i + 1] == 'vv':
		totalvv += 1
ans = 0
cnt = 0
for (i, c) in enumerate(s[1:], 1):
	if c == 'v' and s[i - 1] == 'v':
		cnt += 1
	elif c == 'o':
		ans += cnt * (totalvv - cnt)
print(ans)


s = input()
wow = 0
o_counter = 0
ans = 0
for i in range(len(s)):
	if s[i] == 'o':
		o_counter += wow
	elif i > 0 and s[i - 1] == 'v':
		wow += 1
		ans += o_counter
print(ans)


s = input()
cnt_w = 0
cnt_wo = 0
cnt_wow = 0
last_l = ''
curr_l = ''
for l in s:
	curr_l = l
	if curr_l == 'v' and curr_l == last_l:
		cnt_w += 1
		if cnt_wo:
			if cnt_wow:
				cnt_wow = cnt_wow + cnt_wo
			else:
				cnt_wow = cnt_wo
	elif curr_l == 'o':
		if cnt_wo:
			cnt_wo = cnt_wo + cnt_w
		else:
			cnt_wo = cnt_w
	last_l = l
print(cnt_wow)


c = input()
n = len(c)
d = []
p = None
w = 0
o = 0
l = 0
r = 0
for i in range(n):
	if p == c[i]:
		if p == 'v':
			w += 1
			r += 1
		else:
			o += 1
	elif c[i] == 'v':
		p = 'v'
		w = 0
		if o > 0:
			if len(d) > 0 and d[-1][0] == 'o':
				d[-1][1] += o
			else:
				d.append(['o', o])
	else:
		p = 'o'
		o = 1
		if w > 0:
			if len(d) > 0 and d[-1][0] == 'w':
				d[-1][1] += w
			else:
				d.append(['w', w])
if c[-1] == 'v':
	if w > 1:
		d.append(['w', w])
elif o > 0:
	d.append(['o', o])
a = 0
for i in d:
	if i[0] == 'w':
		l += i[1]
		r -= i[1]
	else:
		a += l * r * i[1]
print(a)


s = input()
tot = 0
c = 0
ans = 0
for i in range(len(s) - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		tot += 1
for i in range(len(s) - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		c += 1
	elif s[i] == 'o':
		ans += c * (tot - c)
print(ans)


a = input()
from collections import defaultdict
b = defaultdict(int)
(l, n, t) = (0, 0, len(a))
for i in range(t - 1):
	if a[i] == 'v' and a[i + 1] == 'v':
		n += 1
	if a[i] == 'o':
		l += 1
		b[l] = n
p = 0
for i in b:
	p = p + b[i] * (n - b[i])
print(p)


s = input()
n = len(s)
L = [0] * n
R = [0] * n
for i in range(0, n, 1):
	if i == 0:
		continue
	if s[i] == 'v' and s[i - 1] == 'v':
		L[i] += 1
	L[i] += L[i - 1]
for i in range(n - 1, -1, -1):
	if i == n - 1:
		continue
	if s[i] == 'v' and s[i + 1] == 'v':
		R[i] += 1
	R[i] += R[i + 1]
ans = 0
for i in range(n):
	if s[i] == 'o':
		ans += L[i] * R[i]
print(ans)


s = input().strip('o')
arr = []
cnt = -1
f = 1
for i in s:
	if i == 'v':
		if f:
			cnt += 1
		else:
			f ^= 1
			arr.append(cnt + 1)
			cnt = 0
	elif f:
		arr.append(cnt)
		cnt = 0
		f ^= 1
	else:
		cnt += 1
arr.append(cnt)
(a, b, ans) = (0, sum(arr[::2]), 0)
for i in range(len(arr)):
	if i & 1:
		ans += a * b * arr[i]
	else:
		a += arr[i]
		b -= arr[i]
print(ans)


s = list(input())
from collections import defaultdict
d = defaultdict(list)
for x in range(len(s) - 1):
	if s[x] == 'v' and s[x + 1] == 'v':
		d['w'].append(x)
	elif s[x] == 'o':
		d['o'].append(x)
if s[-1] == 'o':
	d['o'].append(len(s) - 1)
from bisect import *
t = len(d['w'])
c = 0
for x in d['o']:
	p = bisect_left(d['w'], x)
	p1 = t - p
	c += p * p1
print(c)


inp = input()
mod_inp = []
w_count = 0
c_prev = None
for c in inp:
	if c == 'v' and c_prev == 'v':
		w_count += 1
	if c == 'o':
		mod_inp.append(w_count)
	c_prev = c
total = 0
for ws in mod_inp:
	total += ws * (w_count - ws)
print(total)


s = input()
n = len(s)
s += 'p'
pref = [0] * (n + 1)
for i in range(1, n + 1):
	pref[i] = pref[i - 1]
	if s[i - 1] == 'v' and s[i] == 'v':
		pref[i] += 1
ans = 0
for i in range(n):
	if s[i] == 'o':
		ans += pref[i + 1] * (pref[n] - pref[i + 1])
print(ans)


s = input()
total = 0
temp = 0
for i in s:
	if i == 'v':
		temp += 1
	else:
		total += max(0, temp - 1)
		temp = 0
total += max(0, temp - 1)
curr = 0
temp = 0
ans = 0
for i in s:
	if i == 'v':
		temp += 1
	else:
		curr += max(0, temp - 1)
		temp = 0
		ans += curr * (total - curr)
print(ans)


s = input() + 'o'
a = [0] * len(s)
a = list()
z = 0
b = list()
k = 0
c = list()
L = 0
for i in range(len(s)):
	if s[i] == 'o':
		b.append(max(i - L - 1, 0))
		k += max(i - L - 1, 0)
		a.append(i - L + 1)
		L += i - L + 1
		c.append(k)
for i in c:
	z += i * (k - i)
print(z)


st = input()
li = []
s = 0
for i in range(len(st)):
	if st[i] == 'v':
		s += 1
	else:
		if s > 1:
			li.append(s - 1)
		li.append(0)
		s = 0
if s > 0:
	li.append(s - 1)
pre = []
suf = [0 for i in range(len(li))]
pre.append(li[0])
for i in range(1, len(li)):
	pre.append(pre[i - 1] + li[i])
suf[len(li) - 1] = li[len(li) - 1]
for i in range(len(li) - 2, -1, -1):
	suf[i] = suf[i + 1] + li[i]
ans = 0
for i in range(1, len(li) - 1):
	if li[i] == 0:
		ans += pre[i - 1] * suf[i + 1]
print(ans)


from sys import stdin, stdout
import collections
s = input()
if 'o' not in s:
	print(0)
	quit()
W = [0] * len(s)
v = 0
res = 0
i = 0
for letter in s:
	if letter == 'v':
		v += 1
		if v >= 2:
			res += 1
	else:
		v = 0
	W[i] = res
	i += 1
res = 0
for i in range(len(s)):
	if s[i] == 'o':
		left = W[i]
		right = W[-1] - left
		if left >= 1 and right >= 1:
			res += left * right
print(res)


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
s = input().strip()
an = a = b = 0
for i in range(len(s)):
	if s[i] == 'o':
		b += a
	elif i > 0 and s[i - 1] == 'v':
		a += 1
		an += b
print(an)


x = input()
noOfw = 0
b = 0
count = 0
for i in range(len(x)):
	if x[i] == 'o':
		b += noOfw
	elif i > 0 and x[i - 1] == 'v':
		noOfw += 1
		count += b
print(count)


s = input()
n = len(s)
dp = [0] * n
count1 = 0
count2 = 0
count3 = 0
ways = 0
index = 0
for i in range(n):
	if s[i] == 'v':
		if count1 < 2 or not count2:
			count1 += 1
		else:
			count3 += 1
	else:
		if count1 >= 2:
			count2 += 1
		if count1 < 2:
			count1 = 0
		elif count3 < 2:
			count3 = 0
	if count2 and count1 >= 2 and (count3 >= 2):
		count1 -= 1
		ways = count1 * count2
		dp[i] = ways
		index = i
		break
if not index:
	print(0)
else:
	for i in range(index + 1, n):
		if s[i] == 'v':
			if s[i - 1] != 'v':
				dp[i] = dp[i - 1]
			else:
				dp[i] = dp[i - 1] + ways
			count3 += 1
		else:
			if count3 >= 2:
				ways += count1 + count3 - 1
				count1 += count3 - 1
			else:
				ways += count1
			count3 = 0
			dp[i] = dp[i - 1]
	print(dp[-1])


import sys
input = lambda : sys.stdin.readline().rstrip()
mis = lambda : map(int, input().split())
s = input() + '.'
cnt = 0
v = []
o_cnt = -1
for i in range(len(s)):
	if s[i] == 'v':
		cnt += 1
	else:
		v.append(cnt)
		cnt = 0
		o_cnt += 1
psum = [0] * (o_cnt + 1)
psum[0] = v[0] - 1 if v[0] > 0 else 0
for i in range(1, o_cnt + 1):
	if v[i] > 1:
		psum[i] = psum[i - 1] + v[i] - 1
	else:
		psum[i] = psum[i - 1]
ans = 0
for i in range(o_cnt):
	val = psum[i] * (psum[-1] - psum[i])
	ans += val
print(ans)


s = input()
os = {}
ctv = 0
for i in range(1, len(s)):
	if s[i] == s[i - 1] == 'v':
		ctv += 1
	if s[i] == 'o':
		os[i] = ctv
ct = 0
for i in os:
	ct += os[i] * (ctv - os[i])
print(ct)


s = input()
n = len(s)
out = 0
wCount = 0
oPlace = []
for i in range(n - 1):
	if s[i] == 'o':
		oPlace.append(wCount)
	elif s[i] == 'v' and s[i + 1] == 'v':
		wCount += 1
print(sum([x * (wCount - x) for x in oPlace]))


word = input()
vv = []
o = []
n = len(word)
for i in range(n - 1):
	if i == 0:
		if word[i:i + 2] == 'vv':
			vv.append(1)
		else:
			vv.append(0)
	elif word[i:i + 2] == 'vv':
		vv.append(vv[-1] + 1)
	else:
		vv.append(vv[-1])
if vv != []:
	vv.append(vv[-1])
for i in range(n):
	if word[i] == 'o':
		o.append(i)
if vv == []:
	print(0)
elif vv[-1] < 2 or len(o) == 0:
	print(0)
else:
	ans = 0
	last = vv[-1]
	for i in o:
		ans += vv[i] * (last - vv[i])
	print(ans)


s = input()
n = len(s)
p = [0] * (n + 1)
for x in range(1, n):
	y = 0
	if s[x] == 'v' and s[x - 1] == 'v':
		y = 1
	p[x + 1] = p[x] + y
q = 0
sol = 0
for x in range(n - 3, -1, -1):
	if s[x + 1] == 'v' and s[x + 2] == 'v':
		q += 1
	if s[x] == 'o':
		sol += q * p[x]
print(sol)


a = input()
(b, v, vo, vov) = (0, 0, 0, 0)
for i in range(len(a)):
	if a[i] == 'v':
		if b == 1:
			v += 1
			vov += vo
		else:
			b = 1
	if a[i] == 'o':
		vo += v
		b = 0
print(vov)


a = input()
d = []
l = 0
p = len(a)
for x in range(p):
	if x == p - 1 and a[x] == 'o':
		d.append(0)
	if a[x] == 'v':
		l += 1
	else:
		d.append(l)
		l = 0
d.append(l)
n = 0
dp = []
for x in range(len(d)):
	if d[x] > 0:
		n += d[x] - 1
	dp.append(n)
h = len(dp)
s = 0
for x in range(h):
	s += dp[x] * (dp[-1] - dp[x])
print(s)


s = input()
l = len(s)
w = 0
for i in range(l):
	if s[i:i + 2] == 'vv':
		w += 1
d = 0
ans = 0
for i in range(l):
	if s[i:i + 2] == 'vv':
		w -= 1
		d += 1
	if s[i] == 'o':
		ans += d * w
print(ans)


s = input()
i = 0
count = {'w': 0, 'wo': 0, 'wow': 0}
ans = 0
while i < len(s):
	j = i
	while j + 1 < len(s) and s[j + 1] == s[i]:
		j += 1
	size = j - i + 1
	if s[i] == 'v':
		num = size - 1
		count['wow'] += num * count['wo']
		count['w'] += num
	else:
		count['wo'] += count['w'] * size
	i = j + 1
print(count['wow'])


s = input()
tv_l = [0] * len(s)
tv_p = [0] * len(s)
g_l = 0
g_r = 0
num_v = 0
wyn = 0
if 'v' not in s:
	print('0')
	exit(0)
for x in range(0, len(s), +1):
	if s[x] == 'v':
		num_v += 1
	elif s[x] == 'o':
		if num_v <= 1:
			num_v = 0
			tv_l[x] = g_l
			continue
		g_l += num_v - 1
		tv_l[x] = g_l
		num_v = 0
if s[-1] == 'v':
	if num_v > 1:
		tv_l[-1] = num_v - 1
num_v = 0
for x in range(len(s) - 1, -1, -1):
	if s[x] == 'v':
		num_v += 1
	elif s[x] == 'o':
		if num_v <= 1:
			num_v = 0
			tv_p[x] = g_r
			continue
		g_r += num_v - 1
		tv_p[x] = g_r
		num_v = 0
if s[0] == 'v':
	if num_v > 1:
		tv_p[0] = num_v - 1
for x in range(0, len(s), +1):
	if s[x] == 'o':
		wyn += tv_p[x] * tv_l[x]
print(wyn)


from sys import stdin, stdout, exit
s = stdin.readline().strip()
n = len(s)
ls = []
cur = 0
cur_c = s[0]
for i in range(n):
	if s[i] != cur_c:
		ls.append((cur_c, cur))
		cur = 0
		cur_c = s[i]
	cur += 1
ls.append((cur_c, cur))
ls = [(c, ct if c != 'v' else ct - 1) for (c, ct) in ls]
if ls[0][0] == 'o':
	ls = ls[1:]
if not ls:
	print(0)
	exit()
if ls[-1][0] == 'o':
	ls = ls[:-1]
ws = []
total = 0
for (i, (c, ct)) in enumerate(ls):
	if c == 'v':
		total += ct
		ws.append(total)
ans = 0
for (i, (c, ct)) in enumerate(ls):
	if c == 'o':
		ans += ct * ws[i // 2] * (total - ws[i // 2])
stdout.write(str(ans) + '\n')


s = input()
cum = [0] * len(s)
for i in range(len(s) - 2, -1, -1):
	cum[i] = cum[i + 1] + int(s[i] == 'v' and s[i + 1] == 'v')
ans = 0
for i in range(len(s)):
	if s[i] == 'o':
		ans += (cum[0] - cum[i]) * cum[i]
print(ans)


word = input()
n = len(word)
if n < 4:
	print(0)
	import sys
	sys.exit()
wb4 = [0] * n
wafter = [0] * n
cnt = 0
for i in range(1, n):
	wb4[i] = cnt
	if word[i] == 'v' and word[i - 1] == 'v':
		cnt += 1
cnt = 0
for i in range(n - 2, -1, -1):
	wafter[i] = cnt
	if word[i] == 'v' and word[i + 1] == 'v':
		cnt += 1
ans = 0
for i in range(n):
	if word[i] == 'o':
		ans += wb4[i] * wafter[i]
print(ans)


ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(mi())
si = lambda : input()
s = si()
n = len(s)
w = 0
o = []
for i in range(n):
	if i != n - 1 and s[i] == 'v' and (s[i + 1] == 'v'):
		w += 1
	if s[i] == 'o':
		o.append(w)
print(sum((i * (w - i) for i in o)))


s = input()
dup = []
countv = 0
counto = 0
for i in range(len(s)):
	if s[i] == 'v':
		countv += 1
	else:
		if countv > 0:
			dup.append(countv - 1)
		countv = 0
	if s[i] == 'o':
		counto += 1
	else:
		if counto != 0:
			dup.append(counto)
		counto = 0
if counto > 0:
	dup.append(counto)
if countv > 0:
	dup.append(countv - 1)
d = len(dup)
if s[0] == 'v':
	wynik = 0
	i = 0
	suma = 0
	while i < d:
		suma += dup[i]
		i += 2
	i = 1
	sumap = 0
	while i < d:
		suma -= dup[i - 1]
		sumap += dup[i - 1]
		wynik += sumap * dup[i] * suma
		i += 2
	print(wynik)
else:
	wynik = 0
	i = 1
	suma = 0
	while i < d:
		suma += dup[i]
		i += 2
	i = 2
	sumap = 0
	while i < d:
		suma -= dup[i - 1]
		sumap += dup[i - 1]
		wynik += sumap * dup[i] * suma
		i += 2
	print(wynik)


s = input()
string = s
n = len(s)
a = []
i = 0
while i < n:
	j = 1
	while i < n - 1 and s[i] == s[i + 1]:
		i += 1
		j += 1
	a.append(j)
	i += 1
s = 0
b = []
n = len(a)
if string[0] == 'o':
	a = [1] + a
	n += 1
for i in range(n):
	if i % 2 == 0:
		a[i] -= 1
for i in range(n - 1, -1, -1):
	if i % 2 == 0:
		s += a[i]
	b.append(s)
b.reverse()
b = list(b)
s = 0
ans = 0
for i in range(n):
	if i % 2:
		ans += s * b[i] * a[i]
	else:
		s += a[i]
print(ans)


import sys
s = sys.stdin.readline().strip()
v = []
o = []
f = 1
i = 0
while i < len(s) and s[i] == 'o':
	i += 1
while i < len(s):
	vc = 0
	while i < len(s) and s[i] == 'v':
		vc += 1
		i += 1
	v.append(vc - 1)
	oc = 0
	while i < len(s) and s[i] == 'o':
		oc += 1
		i += 1
	o.append(oc)
op = 0
su = []
suu = 0
for i in range(len(v)):
	suu += v[i]
	su.append(suu)
vts = sum(v)
for x in range(len(o)):
	op = op + su[x] * o[x] * (vts - su[x])
print(op)


s = input()
ns = ''
for i in range(len(s) - 1):
	if s[i] == 'v' and s[i + 1] == 'v':
		ns += 'w'
	else:
		ns += s[i]
(w, o) = (0, 0)
tot = 0
for i in ns:
	if i == 'w':
		tot += o
		w += 1
	elif i == 'o':
		o += w
print(tot)


import sys

def rl(proc=None):
	if proc is not None:
		return proc(sys.stdin.readline())
	else:
		return sys.stdin.readline().rstrip()

def srl(proc=None):
	if proc is not None:
		return list(map(proc, rl().split()))
	else:
		return rl().split()

def main():
	s = rl()
	count = [0, 0]
	for i in range(1, len(s)):
		if s[i] == s[i - 1] == 'v':
			count.append(count[-1] + 1)
		else:
			count.append(count[-1])
	ret = 0
	for (i, x) in enumerate(s):
		if x == 'o':
			ret += count[i] * (count[-1] - count[i])
	print(ret)
main()


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def YES(c):
	return IF(c, 'YES', 'NO')

def Yes(c):
	return IF(c, 'Yes', 'No')

def main():
	t = 1
	rr = []
	for _ in range(t):
		s = S()
		l = len(s)
		a = [0]
		b = [0]
		for i in range(1, l):
			if s[i] == 'v' and s[i - 1] == 'v':
				a.append(a[-1] + 1)
			else:
				a.append(a[-1])
		for i in range(l - 2, -1, -1):
			if s[i] == 'v' and s[i + 1] == 'v':
				b.append(b[-1] + 1)
			else:
				b.append(b[-1])
		b = b[::-1]
		r = 0
		for (i, c) in enumerate(s):
			if c == 'o':
				r += a[i] * b[i]
		rr.append(r)
	return JA(rr, '\n')
print(main())


s = input()
a = [0]
t = 0
for (x, y) in zip(s, s[1:]):
	t += x + y == 'vv'
	a += (t,)
print(sum((x * (a[-1] - y) * (z == 'o') for (x, y, z) in zip(a, a[1:], s))))


s = input()
n = len(s)
a = []
b = []
temp = []
count = 0
for i in range(n):
	a.append(count)
	if i < n - 1 and s[i] == 'v' and (s[i + 1] == 'v'):
		count += 1
	if s[i] == 'o':
		temp.append(i)
count = 0
for i in range(n - 1, -1, -1):
	b.append(count)
	if i > 0 and s[i] == 'v' and (s[i - 1] == 'v'):
		count += 1
b.reverse()
total = 0
for i in temp:
	total += a[i] * b[i]
print(total)


def find(s):
	left = [0] * len(s)
	right = [0] * len(s)
	temp = 0
	for i in range(1, len(s)):
		if s[i - 1] == s[i] and s[i] == 'v':
			temp += 1
		left[i] = temp
	temp = 0
	for i in range(len(s) - 2, -1, -1):
		if s[i + 1] == s[i] and s[i] == 'v':
			temp += 1
		right[i] = temp
	ans = 0
	for i in range(len(s)):
		if s[i] == 'o':
			if i > 1:
				ans += left[i] * right[i]
	return ans
print(find(input()))


x = map(len, input().split('o'))
y = [max(v - 1, 0) for v in x]
r = 0
s = 0
ss = 0
for v in y:
	r += v * s
	ss += v
	s += ss
print(r)


from sys import stdin
from math import gcd, sqrt
from collections import deque
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
hg = lambda x, y: (y + x - 1) // x * x
s = S()
cnt = 0
a = []
for i in range(1, len(s)):
	if s[i] == s[i - 1] == 'v':
		cnt += 1
	elif s[i] == 'o':
		a += (cnt,)
ans = 0
for i in a:
	ans += (cnt - i) * i
print(ans)


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 10 ** 5 + 10
MOD = 10 ** 9 + 7

def isprime(n):
	n = abs(int(n))
	if n < 2:
		return False
	if n == 2:
		return True
	if not n & 1:
		return False
	for x in range(3, int(n ** 0.5) + 1, 2):
		if n % x == 0:
			return False
	return True

def mhd(a, b):
	return abs(a[0] - b[0]) + abs(b[1] - a[1])

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN(x=' '):
	return list(map(int, sys.stdin.readline().strip().split(x)))

def eld(x, y):
	a = y[0] - x[0]
	b = x[1] - y[1]
	return (a * a + b * b) ** 0.5

def lgcd(a):
	g = a[0]
	for i in range(1, len(a)):
		g = math.gcd(g, a[i])
	return g

def ms(a):
	msf = -MAX
	meh = 0
	st = en = be = 0
	for i in range(len(a)):
		meh += a[i]
		if msf < meh:
			msf = meh
			st = be
			en = i
		if meh < 0:
			meh = 0
			be = i + 1
	return (msf, st, en)

def ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % MOD
		den = den * (i + 1) % MOD
	return num * pow(den, MOD - 2, MOD) % MOD

def flush():
	return sys.stdout.flush()
s = input()
n = len(s)
v = [i for i in range(n - 1) if s[i:i + 2] == 'vv']
o = [i for i in range(n) if s[i] == 'o']
x = len(v)
ans = 0
for i in o:
	idx = bisect_left(v, i)
	ans += idx * (x - idx)
print(ans)


s = input()
factor = 0
total_ws = 0
consecutive_vs = 0
for c in s + 'o':
	if c == 'v':
		consecutive_vs += 1
	else:
		total_ws += max(0, consecutive_vs - 1)
		consecutive_vs = 0
prefix_ws = 0
consecutive_vs = 0
for c in s:
	if c == 'v':
		consecutive_vs += 1
	else:
		prefix_ws += max(0, consecutive_vs - 1)
		consecutive_vs = 0
		factor += prefix_ws * (total_ws - prefix_ws)
print(factor)


s = input()
sum_v = 0
for i in range(len(s) - 1):
	if s[i] + s[i + 1] == 'vv':
		sum_v += 1
ans = 0
current_sum = 0
for i in range(len(s) - 1):
	if s[i] + s[i + 1] == 'vv':
		current_sum += 1
	elif s[i] == 'o':
		ans += (sum_v - current_sum) * current_sum
print(ans)


a = input()
res = ''
if len(a) < 3:
	print(0)
	exit()
for i in range(len(a) - 1):
	if a[i] == 'v' and a[i + 1] == 'v':
		res += 'w'
	elif a[i] == 'v' and a[i + 1] == 'o':
		continue
	else:
		res += 'o'
s = 0
a = []
for i in range(len(res)):
	if res[i] == 'w':
		s += 1
t = 0
rs = 0
for i in range(len(res)):
	if res[i] == 'o':
		rs += t * (s - t)
	else:
		t += 1
print(rs)


s = input()
n = len(s)
left = [0] * n
right = [0] * n
for i in range(1, n):
	left[i] = left[i - 1]
	if s[i] == 'v' and s[i - 1] == 'v':
		left[i] += 1
for i in range(n - 2, -1, -1):
	right[i] = right[i + 1]
	if s[i] == 'v' and s[i + 1] == 'v':
		right[i] += 1
rtn = 0
for i in range(n):
	if s[i] == 'o':
		rtn += left[i] * right[i]
print(rtn)


s = input()
cntVLeft = 0
cntVRight = 0
sumV = 0
ans = 0
l = [0] * len(s)
k = 0
for i in range(1, len(s)):
	if s[i] == 'v' and s[i - 1] == 'v':
		k += 1
		l[i] = k
	else:
		l[i] = k
for i in range(0, len(s)):
	if s[i] == 'o':
		cntVLeft = l[i]
		cntVRight = k - l[i]
		ans += cntVLeft * cntVRight
print(ans)


s = input()
last_char = ' '
w = 0
lis = []
for i in range(len(s)):
	new_char = s[i]
	if new_char == 'v' and last_char == 'v':
		w += 1
	if new_char == 'o':
		lis.append(w)
	last_char = new_char
tot = 0
for i in lis:
	tot += (w - i) * i
print(tot)


t = input()
k = list(t)
arr = []
count = 0
shout = 0
for i in range(len(t)):
	if k[i] == 'v':
		count = count + 1
	if k[i] == 'o':
		if count > 1:
			arr.append(count)
		count = 0
		arr.append(-1)
if count > 1:
	arr.append(count)
	count = 0
if shout < 0:
	arr.append(shout)
	shout = 0
q = len(arr)
p = 0
k = 0
for i in range(q - 1, -1, -1):
	if arr[i] > 0:
		p = p + (arr[i] - 1)
ans = 0
sh = 0
for i in range(q):
	if arr[i] > 0:
		sh = sh + (arr[i] - 1)
		p = p - (arr[i] - 1)
	if arr[i] < 0:
		ans = ans + sh * (-1 * arr[i]) * p
print(ans)


s = input()
L = []
p = s[0]
y = 1
for i in s[1:]:
	if p == i:
		y += 1
	else:
		L.append([p, y])
		y = 1
		p = i
L.append([p, y])
F = L[:]
g = 0
for j in L:
	if j[0] == 'v':
		g += j[1] - 1
h = 0
for j in F:
	if j[0] == 'o':
		j[1] = j[1] * g
		h += j[1]
	else:
		g = g - j[1] + 1
g = 0
for j in F:
	if j[0] == 'v':
		j[1] = (j[1] - 1) * h
		g += j[1]
	else:
		h = h - j[1]
print(g)


s = input()
(w, wo, wow) = (0, 0, 0)
last = None
for c in s:
	if c == 'v' and last == 'v':
		w += 1
		wow += wo
	elif c == 'o':
		wo += w
	last = c
print(wow)


s = input()
f1 = s.find('vv')
f2 = s.rfind('vv')
s = s[f1:f2 + 2]
s += 'o'
k = []
v = []
p = s[0]
c = 0
l = 0
for i in s[1:]:
	if i == p:
		c += 1
	else:
		if c:
			if p == 'v':
				if k and k[-1] == 'w':
					v[-1] += c
				else:
					k.append('w')
					v.append(c)
					l += 1
			elif k and k[-1] == 'o':
				v[-1] += c
			else:
				k.append('o')
				v.append(c)
				l += 1
		if i == 'v':
			c = 0
		else:
			c = 1
	p = i
s = 0
if v:
	left = [0] * l
	right = [0] * l
	left[0] = v[0]
	right[-1] = v[-1]
	for i in range(2, l, 2):
		left[i] = left[i - 2] + v[i]
		right[l - 1 - i] = right[l + 1 - i] + v[l - 1 - i]
	for i in range(1, l - 1, 2):
		s += left[i - 1] * right[i + 1] * v[i]
print(s)


from collections import defaultdict

def can(spots, sum):
	return 9 * spots >= sum

def biggest(m, s):
	if m == 1 and s <= 9:
		return str(s)
	if m == 1 and s >= 10:
		return 'x'
	if m > 1:
		mx = min(9, s)
		return str(mx) + biggest(m - 1, s - mx)
	return 'x'

def smallest(m, s):
	res = ''
	for i in range(m):
		for digit in range(0, 11):
			if (i > 0 or digit > 0 or (m == 1 and digit == 0)) and can(m - i - 1, s - digit):
				res += str(digit)
				s = s - digit
				break
	return res

def main():
	s = input()
	prefix = defaultdict(int)
	suffix = defaultdict(int)
	for i in range(len(s) - 2, -1, -1):
		if s[i] == 'v' and s[i + 1] == 'v':
			suffix[i] += 1 + suffix[i + 1]
		else:
			suffix[i] = suffix[i + 1]
	for i in range(1, len(s)):
		if s[i] == s[i - 1] == 'v':
			prefix[i] += 1 + prefix[i - 1]
		else:
			prefix[i] = prefix[i - 1]
	ans = 0
	for i in range(len(s)):
		if s[i] == 'o':
			ans += prefix[i - 1] * suffix[i + 1]
	print(ans)
main()


s = list(input())
n = len(s)
ocount = s.count('o')
front = []
back = []
i = 0
k = -1
while i < n:
	if s[i] == 'v':
		k += 1
	else:
		if len(front) > 0:
			if k > 0:
				front.append(front[-1] + k)
			else:
				front.append(front[-1])
		elif k > 0:
			front.append(k)
		else:
			front.append(0)
		k = -1
	i += 1
i = n - 1
k = -1
while i >= 0:
	if s[i] == 'v':
		k += 1
	else:
		if len(back) > 0:
			if k > 0:
				back.append(back[-1] + k)
			else:
				back.append(back[-1])
		elif k > 0:
			back.append(k)
		else:
			back.append(0)
		k = -1
	i -= 1
back.reverse()
ans = 0
for i in range(len(back)):
	ans += front[i] * back[i]
print(ans)


import sys
l = list(sys.stdin.readline())
m = len(l)
vs = []
os = []
i = 0
while i < m and (l[i] == 'o' or (i < m - 1 and l[i + 1] == 'o')):
	i += 1
nos = 0
while i < m - 1:
	if l[i] == 'v' and l[i + 1] == 'v':
		if nos > 0:
			os.append(nos)
			nos = 0
		j = i + 1
		while j < m and l[j] == 'v':
			j += 1
		if j - i - 1 > 0:
			vs.append(j - i - 1)
		i = j
	else:
		if l[i] == 'o':
			nos += 1
		i += 1
n = len(os)
sos = [0] * len(os)
if n == 0:
	print(0)
	exit(0)
sos[0] = os[0]
for k in range(1, len(os)):
	sos[k] = sos[k - 1] + os[k]
svs = [0] * n
svs[-1] = vs[-1]
for k in range(n - 2, -1, -1):
	svs[k] = svs[k + 1] + vs[k + 1]
S = 0
for k in range(n):
	S += sos[k] * vs[k + 1]
ans = 0
for k in range(n):
	ans += vs[k] * S
	S -= svs[k] * os[k]
print(ans)


from sys import stdin
s = stdin.readline().strip()
n = len(s)
l = [0 for i in range(n)]
r = [0 for i in range(n)]

def cal(x):
	return x * (x - 1) // 2
for i in range(n):
	if i == 0:
		continue
	if s[i] == 'v' and s[i - 1] == 'v':
		l[i] += 1
	l[i] += l[i - 1]
for i in range(n - 1, -1, -1):
	if i == n - 1:
		continue
	if s[i] == 'v' and s[i + 1] == 'v':
		r[i] += 1
	r[i] += r[i + 1]
ans = 0
for i in range(n):
	if s[i] == 'o':
		ans += l[i] * r[i]
print(ans)


Input = lambda : map(int, input().split())
s = input()
Len = len(s)
vv = o = ans = 0
for i in range(Len - 1):
	if s[i] == 'o':
		o += vv
	elif s[i] == s[i + 1] == 'v':
		vv += 1
		ans += o
print(ans)


s = input()
i = 0
n = len(s)
if s.count('o') > 0:
	while i < n and s[i] == 'o':
		i += 1
s = s[i:]
n = len(s)
prev = -1
lenv = []
for i in range(n):
	if s[i] == 'o':
		l = i - 1 - prev
		if l > 0:
			lenv.append(l)
		prev = i
l = n - 1 - prev
if l > 0:
	lenv.append(l)
prev = -1
leno = []
for i in range(n):
	if s[i] == 'v':
		l = i - 1 - prev
		if l > 0:
			leno.append(l)
		prev = i
l = n - 1 - prev
if l > 0:
	leno.append(l)
prefo = [0]
for i in range(len(leno)):
	prefo.append(prefo[i] + leno[i])
ans = 0
tmp = 0
for i in range(len(lenv)):
	tmp += (lenv[i] - 1) * prefo[i]
for i in range(len(lenv)):
	tmp -= (lenv[i] - 1) * prefo[i]
	ans += (lenv[i] - 1) * tmp
tmp = 0
for i in range(len(lenv)):
	tmp += lenv[i] - 1
for i in range(len(lenv)):
	tmp -= lenv[i] - 1
	ans -= (lenv[i] - 1) * prefo[i] * tmp
print(ans)


def Input():
	tem = input().split()
	ans = []
	for it in tem:
		ans.append(int(it))
	return ans
s = input()
n = len(s)
dp1 = [0 for i in range(n)]
dp2 = [0 for i in range(n)]
cnt = 1 if s[0] == 'v' else 0
for i in range(1, n):
	if s[i] == 'v':
		cnt += 1
		if cnt > 1:
			dp1[i] = dp1[i - 1] + 1
		else:
			dp1[i] = dp1[i - 1]
	else:
		cnt = 0
		dp1[i] = dp1[i - 1]
cnt = 1 if s[n - 1] == 'v' else 0
for i in range(n - 2, -1, -1):
	if s[i] == 'v':
		cnt += 1
		if cnt > 1:
			dp2[i] = dp2[i + 1] + 1
		else:
			dp2[i] = dp2[i + 1]
	else:
		cnt = 0
		dp2[i] = dp2[i + 1]
ans = 0
for i in range(1, n - 1):
	if s[i] == 'o':
		ans += dp1[i - 1] * dp2[i + 1]
print(ans)


import sys
input = sys.stdin.readline
s = input().strip()
(a, b, c) = (0, 0, 0)
for i in range(len(s)):
	if s[i] == 'o':
		b += a
	elif i > 0 and s[i - 1] == 'v':
		a += 1
		c += b
print(c)


import math
import sys
import collections

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def nos(s, t):
	n = len(s)
	k = len(t)
	r = [0] * (k + 1)
	r[0] = 1
	for i in range(n):
		for j in range(k - 1, -1, -1):
			if t[j] == s[i]:
				r[j + 1] = r[j + 1] + r[j]
	return r[k]
s = input()
if len(s) < 5:
	print(0)
	exit()
n = len(s)
r = []
i = 0
while i < n - 1:
	t = 0
	while i < n - 1 and s[i] != s[i + 1] != 'v':
		i += 1
	while i < n and s[i] == 'v':
		t += 1
		i += 1
	r.append(t - 1)
	t = 0
	while i < n - 1 and (s[i] != 'v' or s[i + 1] != 'v'):
		if s[i] == 'o':
			t += 1
		i += 1
	r.append(t)
news = []
m = 'w'
mode = ['w', 'o']
for i in r:
	news.append(m * i)
	m = mode[m == 'w']
print(nos(''.join(news), 'wow'))


def lcs(s, m):
	dp = [[0 for i in range(m + 1)] for i in range(4)]
	b = ['w', 'o', 'w']
	for i in range(m + 1):
		dp[0][i] = 1
	for i in range(1, 4):
		for j in range(1, m + 1):
			if b[i - 1] == s[j - 1]:
				dp[i][j] = dp[i][j - 1] + dp[i - 1][j - 1]
			else:
				dp[i][j] = dp[i][j - 1]
	return dp[3][m]
a = list(input())
n = len(a)
b = []
m = 0
for i in range(n - 1):
	if a[i] == 'v' and a[i + 1] == 'v':
		b.append('w')
		m += 1
	else:
		b.append(a[i])
		m += 1
print(lcs(b, m))


s = input()
i = 0
count = [0, 0, 0]
ans = 0
while i < len(s):
	j = i
	while j + 1 < len(s) and s[j + 1] == s[i]:
		j += 1
	size = j - i + 1
	if s[i] == 'v':
		num = size - 1
		count[2] += num * count[1]
		count[0] += num
	else:
		count[1] += count[0] * size
	i = j + 1
print(count[2])


from sys import stdin
input = stdin.readline
s = input().lstrip('o').rstrip('\n').rstrip('o')
wPre = [0]
oPre = [0]
if len(s) == 0:
	print(0)
	raise SystemExit
W = True
c = 0
i = 0
while i < len(s):
	if W:
		if s[i] == 'v':
			c += 1
			i += 1
		else:
			wPre.append(wPre[-1] + c - 1)
			c = 0
			W = False
	elif s[i] == 'o':
		c += 1
		i += 1
	else:
		oPre.append(oPre[-1] + c)
		c = 0
		W = True
if W:
	wPre.append(wPre[-1] + c - 1)
else:
	oPre.append(oPre[-1] + c)
answer = 0
for i in range(1, len(oPre)):
	answer += wPre[i] * (oPre[i] - oPre[i - 1]) * (wPre[-1] - wPre[i])
print(answer)


a = input()
l = len(a)
t = 0
total_w = 0
for i in range(l - 1):
	if a[i] == 'v' and a[i + 1] == 'v':
		total_w += 1
current_w = 0
for i in range(l - 1):
	if a[i] == 'v' and a[i + 1] == 'v':
		current_w += 1
	if a[i] == 'o':
		t += current_w * (total_w - current_w)
print(t)


s = input()
seq = [0]
cur = 0
for i in range(len(s)):
	if s[i] == 'v':
		cur += 1
	elif s[i] == 'o':
		seq.append(seq[-1] if cur == 0 else seq[-1] + cur - 1)
		cur = 0
if cur >= 2:
	if seq:
		seq.append(seq[-1] + cur - 1)
count = 0
for i in range(len(seq) - 1):
	count += seq[i] * (seq[-1] - seq[i])
print(count)


s = input()
mas = [0]
ans = 0
v = 0
p = 0
for i in range(len(s)):
	if i > 0 and s[i] == 'v' and (s[i - 1] == 'v'):
		mas[len(mas) - 1] += 1
		v += 1
		p += 1
	elif s[i] == 'o':
		p = 0
		mas.append(0)
lev = 0
pr = v
for i in range(len(mas)):
	if mas[i] != 0:
		lev += mas[i]
		pr -= mas[i]
	ans += lev * pr
print(ans)


def ncr(n):
	return n * (n - 1) * (n - 2) // 6
s = input()
a1 = [0] * len(s)
tot = 0
current = 0
a2 = [0] * len(s)
for i in range(len(s)):
	if tot >= 2:
		a1[i] = tot + current - 1
	else:
		a1[i] = current
	if s[i] == 'v':
		tot += 1
	else:
		if tot > 1:
			current += tot - 1
		tot = 0
tot = 0
current = 0
for i in range(len(s) - 1, -1, -1):
	if tot >= 2:
		a2[i] = tot + current - 1
	else:
		a2[i] = current
	if s[i] == 'v':
		tot += 1
	else:
		if tot > 1:
			current += tot - 1
		tot = 0
tot = 0
ans = 0
ans = 0
for i in range(len(s)):
	if s[i] == 'o' and a1[i] > 0 and (a2[i] > 0):
		left = a1[i]
		right = a2[i]
		ans += left * right
print(ans)


s = input()
firstv = True
w = 0
wo = 0
wow = 0
for c in s:
	if c == 'v':
		if not firstv:
			w += 1
			wow += wo
		firstv = False
	else:
		wo += w
		firstv = True
print(wow)


def dp(n):
	memo = [[0 for i in range(n + 1)] for j in range(4)]
	for i in range(4):
		for j in range(n + 1):
			if i == 0:
				memo[i][j] = 1
			elif j == 0:
				memo[i][j] = 0
			elif a[j - 1] == b[i - 1]:
				memo[i][j] = memo[i - 1][j - 1] + memo[i][j - 1]
			else:
				memo[i][j] = memo[i][j - 1]
	return memo[3][n]
s = list(input())
a = []
n = len(s)
i = 0
b = list('wow')
while i < n - 1:
	if s[i] == 'v' and s[i] == s[i + 1]:
		a.append('w')
	elif s[i] == 'o':
		a.append('o')
	i += 1
print(dp(len(a)))


ans = 0
cnt = 0
sz = 0
tot = 0
for c in input():
	if c == 'o':
		tot += max(0, sz - 1)
		cnt += tot
		sz = 0
	else:
		sz += 1
		if sz > 1:
			ans += cnt
print(ans)


import sys

def binary(num):
	left = 0
	right = m
	while left < right:
		mid = (left + right) // 2
		if ans[mid][1] < num:
			left = mid + 1
		else:
			right = mid
	return right
arr = list(sys.stdin.readline().rstrip())
n = len(arr)
i = 0
ans = []
while i < n:
	if arr[i] == 'v':
		j = i
		while j < n:
			if arr[j] == 'o':
				break
			j += 1
		if j - i >= 2:
			ans.append((j - i, i, j))
		i = j
	else:
		i += 1
m = len(ans)
temp = [0] * n
for i in range(n):
	if arr[i] == 'o':
		temp[i] += 1
pfo = [0] * n
pfo[0] = temp[0]
for i in range(1, n):
	pfo[i] = pfo[i - 1] + temp[i]
pfv = [0] * m
if ans:
	pfv[0] = ans[0][0] - 1
	for i in range(1, m):
		pfv[i] = pfv[i - 1] + ans[i][0] - 1
res = 0
for i in range(n):
	if temp[i]:
		idx = binary(i)
		if 1 <= idx <= m - 1:
			res += pfv[idx - 1] * (pfv[m - 1] - pfv[idx - 1])
print(res)


from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf
import math

def sp():
	return map(int, input().split())

def fun(x):
	return sum((int(i) for i in str(x)))
s = input()
n = len(s)
ans = ''
for i in range(1, n):
	if s[i] == 'v' and s[i - 1] == 'v':
		ans += 'w'
	elif s[i] == 'o':
		ans += 'o'
n = len(ans)
l = [0] * n
cnt_v = 0
for i in range(n):
	if ans[i] == 'w':
		cnt_v += 1
		l[i] = cnt_v
cnt = 0
last = 0
for i in range(n):
	if l[i] == 0:
		cnt += last * (cnt_v - last)
	else:
		last = l[i]
print(cnt)


s = '#' + input() + '#'
sR = s[::-1]
L = []
R = []
cnt = 0
for i in range(1, len(s)):
	if s[i - 1] == 'v' and s[i] == 'v':
		cnt += 1
	elif s[i] == 'o':
		L.append(cnt)
cnt = 0
for i in range(1, len(sR)):
	if sR[i - 1] == 'v' and sR[i] == 'v':
		cnt += 1
	elif sR[i] == 'o':
		R.append(cnt)
R.reverse()
res = 0
for i in range(0, len(L)):
	res += L[i] * R[i]
print(res)


s = input()
a = []
i = 0
for x in s:
	if x == 'o':
		a.append(i)
		i = 0
	else:
		i += 1
a.append(i)
for i in range(len(a)):
	if a[i] > 0:
		a[i] -= 1
s = sum(a)
t = 0
ans = 0
for i in range(len(a) - 1):
	t += a[i]
	ans += t * (s - t)
print(ans)


import math
s = input()
wcount = ocount = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1] == 'v':
		wcount += 1
wbeyond = wcount
wafter = [0] * len(s)
for i in range(len(s) - 1):
	if s[i] == s[i + 1] == 'v':
		wbeyond -= 1
	wafter[i] = wbeyond
a = [0] * len(s)
for i in reversed(range(len(s) - 1)):
	a[i] = a[i + 1]
	if s[i] == 'o':
		a[i] += wafter[i]
count = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1] == 'v':
		count += a[i]
print(count)


a = input()
len = len(a)
ans = 0
w = 0
o = 0
for i in range(len):
	if a[i] == 'o':
		o += w
	elif i > 0 and a[i - 1] == 'v':
		w += 1
		ans += o
print(ans)


s = input()
prev = ''
cnt = 0
for elem in s:
	if elem == 'v' and prev == 'v':
		cnt += 1
	prev = elem
n = 0
prev = ''
ans = 0
for elem in s:
	if elem == 'v' and prev == 'v':
		n += 1
	if elem == 'o':
		ans += n * (cnt - n)
	prev = elem
print(ans)


s = input()
N = len(s)
d1 = [0] * N
d2 = [0] * N
for i in range(N - 1):
	if s[i:i + 2] == 'vv':
		d1[i] += 1
for i in range(1, N):
	d1[i] += d1[i - 1]
for i in range(N - 1, 0, -1):
	if s[i] == 'v' and s[i - 1] == 'v':
		d2[i] = 1
for i in range(N - 2, -1, -1):
	d2[i] += d2[i + 1]
ans = 0
for i in range(N):
	if s[i] == 'o':
		ans += d1[i] * d2[i]
print(ans)


s = input()
n = len(s)
arr = [0 for i in range(n)]
arr[0] = 0
for i in range(1, n):
	if s[i] == s[i - 1] == 'v':
		arr[i] = arr[i - 1] + 1
	else:
		arr[i] = arr[i - 1]
arr1 = [0 for i in range(n)]
arr1[0] = 0
for i in range(1, n):
	if s[i] == 'o':
		arr1[i] = arr1[i - 1] + arr[i]
	else:
		arr1[i] = arr1[i - 1]
arr2 = [0 for i in range(n)]
arr2[0] = 0
for i in range(1, n):
	if s[i] == s[i - 1] == 'v':
		arr2[i] = arr2[i - 1] + arr1[i]
	else:
		arr2[i] = arr2[i - 1]
print(arr2[-1])


s = input()
n = len(s)
ldp = [0 for i in range(n)]
rdp = [0 for i in range(n)]
consec = 0
for i in range(n):
	if s[i] == 'v':
		consec += 1
	else:
		consec = 0
	if consec > 1:
		ldp[i] = ldp[i - 1] + 1
	else:
		ldp[i] = ldp[i - 1]
consec = s[-1] == 'v'
for i in range(n - 2, -1, -1):
	if s[i] == 'v':
		consec += 1
	else:
		consec = 0
	if consec > 1:
		rdp[i] = rdp[i + 1] + 1
	else:
		rdp[i] = rdp[i + 1]
ans = 0
for i in range(n):
	if s[i] == 'o':
		ans += ldp[i] * rdp[i]
print(ans)


s = input()
prev = 'o'
ws = 0
for char in s:
	if char == prev == 'v':
		ws += 1
	prev = char
tot = 0
seen = 0
prev = 'o'
for char in s:
	if char == 'o':
		tot += seen * (ws - seen)
	elif char == prev == 'v':
		seen += 1
	prev = char
print(tot)


s = input()
c = 0
a = []
for i in range(len(s)):
	if i < len(s) - 1 and s[i] == 'v' and (s[i + 1] == 'v'):
		c += 1
	if s[i] == 'o':
		a.append(c)
if s[len(s) - 1] != 'o':
	a.append(c)
ll = len(a)
c = 0
for j in range(ll - 1):
	c += a[j] * (a[ll - 1] - a[j])
print(c)


s = input()
oo = []
vv = []
inde = []
count = 0
if s[0] == 'o':
	oo.append(0)
else:
	count += 1
for i in range(1, len(s)):
	if s[i] == s[i - 1]:
		if s[i] == 'o':
			oo.append(i)
			vv.append(count)
		else:
			count += 1
	elif s[i] == 'o':
		vv.append(count)
		inde.append(i)
		count = 0
		oo.append(i)
	else:
		count = 1
vv.append(count)
for i in range(len(vv)):
	vv[i] = max(vv[i] - 1, 0)
ss = vv.copy()
r = sum(vv)
for i in range(1, len(vv)):
	vv[i] += vv[i - 1]
for i in range(len(ss)):
	ss[i] = r - vv[i]
total = 0
for i in range(len(vv)):
	total += vv[i] * ss[i]
print(total)


from sys import stdin, stdout
import math
s = input().split('o')
a = []
tsum = 0
for x in s:
	a.append(len(x) - 1)
	if len(x) != 0:
		tsum += len(x) - 1
res = 0
prev = 0
lsum = 0
for i in range(len(a) - 1):
	if a[i] != -1:
		lsum += a[i]
		tsum -= a[i]
		res += lsum * tsum
	else:
		res += lsum * tsum
print(res)


import re
import sys
str = re.split('(o+)', input())
str = list(filter(None, str))
ind = len(str) - 3
if ind >= 0:
	if str[ind].find('v') == -1:
		ind = ind - 1
res = 0
if ind >= 0:
	cntWOW = 0
	cntOW = 0
	cntW = 0
	for i in range(ind, -1, -2):
		cntW += len(str[i + 2]) - 1
		cntOW += len(str[i + 1]) * cntW
		cntWOW += (len(str[i]) - 1) * cntOW
	res = cntWOW
print(res)


st = input()
n = len(st)
left = [0 for k in range(n)]
right = [0 for k in range(n)]
for k in range(1, n):
	if st[k] == 'v' and st[k] == st[k - 1]:
		left[k] = left[k - 1] + 1
	else:
		left[k] = left[k - 1]
for k in range(2, n + 1):
	if st[n - k] == 'v' and st[n - k] == st[n - k + 1]:
		right[n - k] = right[n - k + 1] + 1
	else:
		right[n - k] = right[n - k + 1]
c = 0
for k in range(n):
	if st[k] == 'o':
		c += left[k] * right[k]
print(c)


def wow(s):
	(x, y, z) = (0, 0, 0)
	for i in range(len(s)):
		if s[i] == 'o':
			y += x
		elif i > 0 and s[i - 1] == 'v':
			x += 1
			z += y
	return z
print(wow(input()))


s = list(input().rstrip())
n = len(s)
i = c = 0
d = [0 for i in range(n + 1)]
while i < n:
	c = 0
	while i < n and s[i] != 'o':
		d[i] = d[i - 1]
		c += 1
		i += 1
	d[i] = d[i - 1] + (c - 1) * (c >= 1)
	i += 1
ans = 0
if d[-1] < d[-2]:
	d[-1] = d[-2]
for i in range(n):
	if s[i] == 'o':
		ans += (d[i] - d[0]) * (d[-1] - d[i + 1])
print(ans)


text = input()
groups_of_w = []
num_vs = 0
for character in text:
	if character == 'v':
		num_vs += 1
	else:
		groups_of_w.append(max(0, num_vs - 1))
		num_vs = 0
groups_of_w.append(max(0, num_vs - 1))
if not groups_of_w:
	print(0)
else:
	before = [0]
	after = [0]
	for group_of_w in groups_of_w[:-1]:
		before.append(before[-1] + group_of_w)
	for pos_group in range(len(groups_of_w) - 1, -1, -1):
		after.append(after[-1] + groups_of_w[pos_group])
	after.reverse()
	solution = 0
	for pos in range(len(before)):
		solution += before[pos] * after[pos]
	print(solution)


s = str(input())
l = len(s)
a = 0
cnt = 0
ans = 0
for i in range(1, l):
	if s[i] == 'o':
		cnt += a
	elif i > 0 and s[i - 1] == 'v':
		a = a + 1
		ans = ans + cnt
print(ans)


s = input()
a = []
n = len(s)
i = 0
count_all = 0
while i < n:
	if s[i] == 'v':
		count = 0
		i += 1
		while i < n and s[i] == 'v':
			count += 1
			i += 1
		a.append(count)
		count_all += count
	else:
		a.append('o')
		i += 1
ans1 = 0
ans2 = count_all
my_ans = 0
for i in range(len(a)):
	if a[i] != 'o':
		ans1 += a[i]
		ans2 -= a[i]
		x = ans1 * ans2
	elif a[i] == 'o':
		my_ans += ans1 * ans2
print(my_ans)


s = list(input())
(wow, flag, ct, c) = ([], False, [], 0)
for i in range(1, len(s)):
	if s[i - 1] == 'v' and s[i] == 'v':
		wow.append('w')
		c += 1
		ct.append(c)
		flag = True
	elif s[i] == 'o' and flag:
		wow.append('o')
		ct.append(c)
if wow.count('o') == 0:
	print(0)
else:
	res = 0
	for i in range(1, len(wow)):
		if wow[i] == 'o':
			res += ct[i] * (ct[-1] - ct[i])
	print(res)


s = list(input())
n = len(s)
a = 0
b = 0
ans = 0
for i in range(n):
	if s[i] == 'o':
		b += a
	elif i > 0 and s[i - 1] == 'v':
		a += 1
		ans += b
print(ans)


from sys import stdin, stdout
import math, sys, heapq
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import random
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

	def In():
		return map(int, stdin.readline().split())

def dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def find_gt(a, x):
	i = bi.bisect_left(a, x)
	if i != len(a):
		return i
	else:
		return -1

def main():
	try:
		s = input()
		n = len(s)
		(nov, noo) = (0, 0)
		(dpo, dpv) = ([], [])
		t = s[0]
		q = 0
		if s[0] == 'v':
			pos = 0
		else:
			pos = -1
		if s[0] == 'v':
			nov = 1
		total = 0
		for i in range(1, n - 1):
			if s[i] == 'v':
				if s[i + 1] == 'o' and s[i - 1] == 'o':
					continue
				else:
					if noo > 0:
						if len(dpv):
							dpo.append(noo)
						noo = 0
					nov += 1
			else:
				noo += 1
				if nov > 1:
					dpv.append(nov - 1)
					total += nov - 1
				nov = 0
		if nov:
			if s[-1] == 'v':
				dpv.append(nov)
				total += nov
			else:
				dpv.append(nov - 1)
				total += nov - 1
		ans = 0
		for i in range(len(dpv) - 1):
			total -= dpv[i]
			if i > 0:
				dpv[i] += dpv[i - 1]
			ans += dpo[i] * dpv[i] * total
		print(ans)
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(1):
	main()