import re

print((sum(sum(i * (i - 1) // 2 for i in p) + max(p) for p in (tuple(map(len, m)) for m in re.findall(r"(<*)(>*)", eval(input()))))))
import re

a=0

for m in re.findall('(<*)(>*)',eval(input())):u,v=list(map(len,m));a+=(u*u-u+v*v-v)//2+max(u,v)

print(a)
import re

print(
    (
        sum(
            sum(i * (i - 1) // 2 for i in p) + max(p)
            for p in (
                tuple(map(len, m)) for m in re.findall(r"(<*)(>*)", eval(input()))
            )
        )
    )
)

import re

a = 0
for m in re.findall("(<*)(>*)", eval(input())):
    u, v = list(map(len, m))
    a += (u * u - u + v * v - v) // 2 + max(u, v)
print(a)

-print( -    ( -        sum( -            sum(i * (i - 1) // 2 for i in p) + max(p) -            for p in ( -                tuple(map(len, m)) for m in re.findall(r"(<*)(>*)", eval(input())) -            ) -        ) -    ) -) +a = 0 +for m in re.findall("(<*)(>*)", eval(input())): +    u, v = list(map(len, m)) +    a += (u * u - u + v * v - v) // 2 + max(u, v) +print(a)