from itertools import groupby



r = p = 0

for k, g in groupby(eval(input())):

    l = sum(1 for _ in g)

    r += l * (l + 1) // 2

    if k == '>':

        r -= min(l, p)

    p = l

print(r)

from itertools import groupby

 

r = p = 0

for k, g in groupby(eval(input())):

    i = 0

    for _ in g:

        i += 1

        r += i

    if k == '>':

        r -= min(i, p)

    p = i

print(r)

from itertools import groupby

r = p = 0
for k, g in groupby(eval(input())):
    l = sum(1 for _ in g)
    r += l * (l + 1) // 2
    if k == ">":
        r -= min(l, p)
    p = l
print(r)

from itertools import groupby

r = p = 0
for k, g in groupby(eval(input())):
    i = 0
    for _ in g:
        i += 1
        r += i
    if k == ">":
        r -= min(i, p)
    p = i
print(r)

-    l = sum(1 for _ in g) -    r += l * (l + 1) // 2 +    i = 0 +    for _ in g: +        i += 1 +        r += i -        r -= min(l, p) -    p = l +        r -= min(i, p) +    p = i