s=eval(input())

n=len(s)

a=[0]*(n+1)

for i in range(n):

    if s[i]=="<":

        a[i+1]=a[i]+1

for i in reversed(list(range(n))):

    if s[i]==">":

        a[i]=max(a[i+1]+1,a[i])

print((sum(a))) 
s=eval(input())

n=len(s)

a=[0]*(n+1)

for i in range(n):

    if s[i]=="<":

        a[i+1]=a[i]+1

for i in range(n)[::-1]:

    if s[i]==">":

        a[i]=max(a[i+1]+1,a[i])

print((sum(a)))
s = eval(input())
n = len(s)
a = [0] * (n + 1)
for i in range(n):
    if s[i] == "<":
        a[i + 1] = a[i] + 1
for i in reversed(list(range(n))):
    if s[i] == ">":
        a[i] = max(a[i + 1] + 1, a[i])
print((sum(a)))

s = eval(input())
n = len(s)
a = [0] * (n + 1)
for i in range(n):
    if s[i] == "<":
        a[i + 1] = a[i] + 1
for i in range(n)[::-1]:
    if s[i] == ">":
        a[i] = max(a[i + 1] + 1, a[i])
print((sum(a)))

-for i in reversed(list(range(n))): +for i in range(n)[::-1]: