s=list(eval(input()))



right = [0]



left = [0]



count = 0

for i in range(len(s)):

    if s[i] == '<':

        count += 1

    else:

        count = 0

    right.append(count)

count = 0

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

    if s[i] == '>':

        count += 1

    else:

        count = 0

    left.append(count)

left.reverse()



ans = 0



for i in range(len(s)+1):

    ans += max(right[i],left[i])

print(ans)
S = list(eval(input()))



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



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



for i in range(len(S)):

    if S[i] == '<':

        left[i+1] += 1+left[i]



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

    if S[i] == '>':

        right[i] = right[i+1]+1



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

for i in range(len(S)+1):

    ans[i] = max(left[i],right[i])

print((sum(ans)))
s = list(eval(input()))
right = [0]
left = [0]
count = 0
for i in range(len(s)):
    if s[i] == "<":
        count += 1
    else:
        count = 0
    right.append(count)
count = 0
for i in range(len(s) - 1, -1, -1):
    if s[i] == ">":
        count += 1
    else:
        count = 0
    left.append(count)
left.reverse()
ans = 0
for i in range(len(s) + 1):
    ans += max(right[i], left[i])
print(ans)

S = list(eval(input()))
left = [0] * (len(S) + 1)
right = [0] * (len(S) + 1)
for i in range(len(S)):
    if S[i] == "<":
        left[i + 1] += 1 + left[i]
for i in range(len(S) - 1, -1, -1):
    if S[i] == ">":
        right[i] = right[i + 1] + 1
ans = [0] * (len(S) + 1)
for i in range(len(S) + 1):
    ans[i] = max(left[i], right[i])
print((sum(ans)))

-s = list(eval(input())) -right = [0] -left = [0] -count = 0 -for i in range(len(s)): -    if s[i] == "<": -        count += 1 -    else: -        count = 0 -    right.append(count) -count = 0 -for i in range(len(s) - 1, -1, -1): -    if s[i] == ">": -        count += 1 -    else: -        count = 0 -    left.append(count) -left.reverse() -ans = 0 -for i in range(len(s) + 1): -    ans += max(right[i], left[i]) -print(ans) +S = list(eval(input())) +left = [0] * (len(S) + 1) +right = [0] * (len(S) + 1) +for i in range(len(S)): +    if S[i] == "<": +        left[i + 1] += 1 + left[i] +for i in range(len(S) - 1, -1, -1): +    if S[i] == ">": +        right[i] = right[i + 1] + 1 +ans = [0] * (len(S) + 1) +for i in range(len(S) + 1): +    ans[i] = max(left[i], right[i]) +print((sum(ans)))