# https://atcoder.jp/contests/agc040/tasks/agc040_a

s = eval(input())

A = [0] * (len(s) + 1)

B = [0] * (len(s) + 1)

for i in range(len(s)):

    if s[i] == '<':

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



for i in range(len(s))[::-1]:

    if s[i] == '>':

        B[i] = B[i + 1] + 1



ans = 0

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

    ans += max(A[i], B[i])

print(ans)
s = eval(input())



c = 0

dp = [0] * (len(s) + 1)

for i in range(len(s)):

    if s[i] == '<':

        c += 1

        dp[i + 1] = c

    else:

        c = 0

c = 0

for i in range(len(s))[::-1]:

    if s[i] == '>':

        c += 1

        dp[i] = max(dp[i], c)

    else:

        c = 0

ans = sum(dp)

print(ans)
# https://atcoder.jp/contests/agc040/tasks/agc040_a
s = eval(input())
A = [0] * (len(s) + 1)
B = [0] * (len(s) + 1)
for i in range(len(s)):
    if s[i] == "<":
        A[i + 1] = A[i] + 1
for i in range(len(s))[::-1]:
    if s[i] == ">":
        B[i] = B[i + 1] + 1
ans = 0
for i in range(len(s) + 1):
    ans += max(A[i], B[i])
print(ans)

s = eval(input())
c = 0
dp = [0] * (len(s) + 1)
for i in range(len(s)):
    if s[i] == "<":
        c += 1
        dp[i + 1] = c
    else:
        c = 0
c = 0
for i in range(len(s))[::-1]:
    if s[i] == ">":
        c += 1
        dp[i] = max(dp[i], c)
    else:
        c = 0
ans = sum(dp)
print(ans)

-# https://atcoder.jp/contests/agc040/tasks/agc040_a -A = [0] * (len(s) + 1) -B = [0] * (len(s) + 1) +c = 0 +dp = [0] * (len(s) + 1) -        A[i + 1] = A[i] + 1 +        c += 1 +        dp[i + 1] = c +    else: +        c = 0 +c = 0 -        B[i] = B[i + 1] + 1 -ans = 0 -for i in range(len(s) + 1): -    ans += max(A[i], B[i]) +        c += 1 +        dp[i] = max(dp[i], c) +    else: +        c = 0 +ans = sum(dp)