s=eval(input())



list=[0 for _ in range(len(s) + 1)]



def inc(n):

    if n < 0 or len(s) < n + 1:

        return

    if '<' == s[n]:

        if list[n] >= list[n + 1]:

            list[n + 1] += list[n] - list[n + 1] + 1

    elif '>' == s[n]:

        if list[n] <= list[n + 1]:

            list[n] += list[n + 1] - list[n] + 1



for i in range(0, len(s), 1):

    inc(i)



for i in range(len(s) - 1, -1, -1):

    inc(i)



print((sum(list)))

s=eval(input())



list=[0 for _ in range(len(s) + 1)]



for n in range(0, len(s), 1):

    if '<' == s[n] and list[n] >= list[n + 1]:

        list[n + 1] += list[n] - list[n + 1] + 1



for n in range(len(s) - 1, -1, -1):

    if '>' == s[n] and list[n] <= list[n + 1]:

        list[n] += list[n + 1] - list[n] + 1



print((sum(list)))

s = eval(input())
list = [0 for _ in range(len(s) + 1)]


def inc(n):
    if n < 0 or len(s) < n + 1:
        return
    if "<" == s[n]:
        if list[n] >= list[n + 1]:
            list[n + 1] += list[n] - list[n + 1] + 1
    elif ">" == s[n]:
        if list[n] <= list[n + 1]:
            list[n] += list[n + 1] - list[n] + 1


for i in range(0, len(s), 1):
    inc(i)
for i in range(len(s) - 1, -1, -1):
    inc(i)
print((sum(list)))

s = eval(input())
list = [0 for _ in range(len(s) + 1)]
for n in range(0, len(s), 1):
    if "<" == s[n] and list[n] >= list[n + 1]:
        list[n + 1] += list[n] - list[n + 1] + 1
for n in range(len(s) - 1, -1, -1):
    if ">" == s[n] and list[n] <= list[n + 1]:
        list[n] += list[n + 1] - list[n] + 1
print((sum(list)))

- - -def inc(n): -    if n < 0 or len(s) < n + 1: -        return -    if "<" == s[n]: -        if list[n] >= list[n + 1]: -            list[n + 1] += list[n] - list[n + 1] + 1 -    elif ">" == s[n]: -        if list[n] <= list[n + 1]: -            list[n] += list[n + 1] - list[n] + 1 - - -for i in range(0, len(s), 1): -    inc(i) -for i in range(len(s) - 1, -1, -1): -    inc(i) +for n in range(0, len(s), 1): +    if "<" == s[n] and list[n] >= list[n + 1]: +        list[n + 1] += list[n] - list[n + 1] + 1 +for n in range(len(s) - 1, -1, -1): +    if ">" == s[n] and list[n] <= list[n + 1]: +        list[n] += list[n + 1] - list[n] + 1