s = eval(input())

n = len(s) + 1

ans = [0] * n



tmp = 1

ens = list(enumerate(s))

for i, c in ens:

    if c == '<':

        ans[i + 1] = tmp

        tmp += 1

    else:

        tmp = 1



tmp = 1

for i, c in reversed(ens):

    if c == '>':

        ans[i] = max(ans[i], tmp)

        tmp += 1

    else:

        tmp = 1

print((sum(ans)))

import itertools



s = eval(input())

rlc = [len(list(itr)) for _, itr in itertools.groupby(s)]

for i in range(s[0] == '>', len(rlc) - 1, 2):

    if rlc[i] < rlc[i + 1]:

        rlc[i] -= 1

    else:

        rlc[i + 1] -= 1



print((sum(l * (l + 1) // 2 for l in rlc)))

s = eval(input())
n = len(s) + 1
ans = [0] * n
tmp = 1
ens = list(enumerate(s))
for i, c in ens:
    if c == "<":
        ans[i + 1] = tmp
        tmp += 1
    else:
        tmp = 1
tmp = 1
for i, c in reversed(ens):
    if c == ">":
        ans[i] = max(ans[i], tmp)
        tmp += 1
    else:
        tmp = 1
print((sum(ans)))

import itertools

s = eval(input())
rlc = [len(list(itr)) for _, itr in itertools.groupby(s)]
for i in range(s[0] == ">", len(rlc) - 1, 2):
    if rlc[i] < rlc[i + 1]:
        rlc[i] -= 1
    else:
        rlc[i + 1] -= 1
print((sum(l * (l + 1) // 2 for l in rlc)))

+import itertools + -n = len(s) + 1 -ans = [0] * n -tmp = 1 -ens = list(enumerate(s)) -for i, c in ens: -    if c == "<": -        ans[i + 1] = tmp -        tmp += 1 +rlc = [len(list(itr)) for _, itr in itertools.groupby(s)] +for i in range(s[0] == ">", len(rlc) - 1, 2): +    if rlc[i] < rlc[i + 1]: +        rlc[i] -= 1 -        tmp = 1 -tmp = 1 -for i, c in reversed(ens): -    if c == ">": -        ans[i] = max(ans[i], tmp) -        tmp += 1 -    else: -        tmp = 1 -print((sum(ans))) +        rlc[i + 1] -= 1 +print((sum(l * (l + 1) // 2 for l in rlc)))