S = eval(input())



N = len(S) + 1

t = [0] * N

for i in range(N - 1):

    if S[i] == '<':

        t[i + 1] = t[i] + 1

for i in range(N - 2, -1, -1):

    if S[i] == '>':

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

print((sum(t)))
import sys

S = list(eval(input()))

lis = [0] * (len(S)+1)

 

if len(S) == 1:

    print((1))

    sys.exit()

 

 

#最初は < を処理する

for i in range(len(S)):

    if S[i] == "<":

        lis[i+1] = lis[i] + 1

 

 

 

 

for j in range(len(S)-1,-1,-1):

    if S[j] == ">":

        lis[j] = max(lis[j],lis[j+1] + 1)

 

 

 

print((sum(lis)))
S = eval(input())
N = len(S) + 1
t = [0] * N
for i in range(N - 1):
    if S[i] == "<":
        t[i + 1] = t[i] + 1
for i in range(N - 2, -1, -1):
    if S[i] == ">":
        t[i] = max(t[i], t[i + 1] + 1)
print((sum(t)))

import sys

S = list(eval(input()))
lis = [0] * (len(S) + 1)
if len(S) == 1:
    print((1))
    sys.exit()
# 最初は < を処理する
for i in range(len(S)):
    if S[i] == "<":
        lis[i + 1] = lis[i] + 1
for j in range(len(S) - 1, -1, -1):
    if S[j] == ">":
        lis[j] = max(lis[j], lis[j + 1] + 1)
print((sum(lis)))

-S = eval(input()) -N = len(S) + 1 -t = [0] * N -for i in range(N - 1): +import sys + +S = list(eval(input())) +lis = [0] * (len(S) + 1) +if len(S) == 1: +    print((1)) +    sys.exit() +# 最初は < を処理する +for i in range(len(S)): -        t[i + 1] = t[i] + 1 -for i in range(N - 2, -1, -1): -    if S[i] == ">": -        t[i] = max(t[i], t[i + 1] + 1) -print((sum(t))) +        lis[i + 1] = lis[i] + 1 +for j in range(len(S) - 1, -1, -1): +    if S[j] == ">": +        lis[j] = max(lis[j], lis[j + 1] + 1) +print((sum(lis)))