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: interview

Starter code:

Solutions:
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)


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]))


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)

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

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()
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(*l)
print(dp[-1])

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()
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()

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
#print(ldp)
#print(rdp)
for i in range(n):
    if(s[i] == 'o'):
        ans += ldp[i] * rdp[i]

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)

3

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))


def __starting_point():
    main()

__starting_point()

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)


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=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
#print(*arr1)
for i in range(len(arr1)):
	ans+=(arr1[i]*(countx-(arr1[i])))

print(ans)

# @author 

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()
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)

ll= lambda : list(map(int,input().split()))
testcases=1
# testcases=int(input())
for testcase in range(testcases):
	s=input()
	n=len(s)
	dp=[0]
	# print(dp)
	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])
	# print(dp)
	ans=0
	for i in range(0,n):
		if s[i]=='o':
			ans+=(dp[i]*(dp[-1]-dp[i]))
	print(ans)



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)


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().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)

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)
    


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()
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()
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)