from itertools import groupby

 

r = p = 0

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

    for i, _ in enumerate(g, 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())):

    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())):
    for i, _ in enumerate(g, 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())):
    i = 0
    for _ in g:
        i += 1
        r += i
    if k == ">":
        r -= min(i, p)
    p = i
print(r)

-    for i, _ in enumerate(g, 1): +    i = 0 +    for _ in g: +        i += 1