from itertools import groupby



s = eval(input())

A = [(key, sum(1 for _ in group)) for key, group in groupby(s)]

tmp = 0

ans = 0

for key, count in A:

    if key == '<':

        ans += count*(count+1)//2

        tmp = count

    else:

        if tmp < count:

            ans -= tmp

            ans += count

        ans += (count-1)*count//2

        tmp = 0

print(ans)

s = eval(input())

n = len(s)+1

A = [0]*n



for i in range(n-1):

    if s[i] == '<':

        A[i+1] = A[i] + 1



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

    if s[i] == '>':

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



print((sum(A)))

from itertools import groupby

s = eval(input())
A = [(key, sum(1 for _ in group)) for key, group in groupby(s)]
tmp = 0
ans = 0
for key, count in A:
    if key == "<":
        ans += count * (count + 1) // 2
        tmp = count
    else:
        if tmp < count:
            ans -= tmp
            ans += count
        ans += (count - 1) * count // 2
        tmp = 0
print(ans)

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

-from itertools import groupby - -A = [(key, sum(1 for _ in group)) for key, group in groupby(s)] -tmp = 0 -ans = 0 -for key, count in A: -    if key == "<": -        ans += count * (count + 1) // 2 -        tmp = count -    else: -        if tmp < count: -            ans -= tmp -            ans += count -        ans += (count - 1) * count // 2 -        tmp = 0 -print(ans) +n = len(s) + 1 +A = [0] * n +for i in range(n - 1): +    if s[i] == "<": +        A[i + 1] = A[i] + 1 +for i in reversed(list(range(n - 1))): +    if s[i] == ">": +        A[i] = max(A[i], A[i + 1] + 1) +print((sum(A)))