S = eval(input())

N = len(S) + 1



# 左に<がいくつ連続しているか

dai = [None] * N

dai[0] = 0



c = 0

for i, si in enumerate(S):

    if si == '<':

        c += 1

    else:

        c = 0

    dai[i+1] = c





# 右に>がいくつ連続しているかを実装を簡単にするためにSをひっくり返して調べる

S = S[::-1]

sho = [None] * N

sho[0] = 0  # 



c = 0

for i, si in enumerate(S):

    if si == '>':

        c += 1

    else:

        c = 0

    sho[i+1] = c



sho = sho[::-1]  # 元に戻す



# print(dai)

# print(sho)



a = [None] * (N)

for i in range(N):

    a[i] = max(dai[i], sho[i])



# print(a)

ans = sum(a)

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

N = len(S) + 1



A = [0] * N



c = 0

for i, si in enumerate(S):

    if si == '<':

        c += 1

    else:

        c = 0

    A[i+1] = c



c = 0

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

    if S[i] == '>':

        c += 1

    else:

        c = 0

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



# print(A)

print((sum(A)))
S = eval(input())
N = len(S) + 1
# 左に<がいくつ連続しているか
dai = [None] * N
dai[0] = 0
c = 0
for i, si in enumerate(S):
    if si == "<":
        c += 1
    else:
        c = 0
    dai[i + 1] = c
# 右に>がいくつ連続しているかを実装を簡単にするためにSをひっくり返して調べる
S = S[::-1]
sho = [None] * N
sho[0] = 0  #
c = 0
for i, si in enumerate(S):
    if si == ">":
        c += 1
    else:
        c = 0
    sho[i + 1] = c
sho = sho[::-1]  # 元に戻す
# print(dai)
# print(sho)
a = [None] * (N)
for i in range(N):
    a[i] = max(dai[i], sho[i])
# print(a)
ans = sum(a)
print(ans)

S = eval(input())
N = len(S) + 1
A = [0] * N
c = 0
for i, si in enumerate(S):
    if si == "<":
        c += 1
    else:
        c = 0
    A[i + 1] = c
c = 0
for i in range(len(S) - 1, -1, -1):
    if S[i] == ">":
        c += 1
    else:
        c = 0
    A[i] = max(A[i], c)
# print(A)
print((sum(A)))

-# 左に<がいくつ連続しているか -dai = [None] * N -dai[0] = 0 +A = [0] * N -    dai[i + 1] = c -# 右に>がいくつ連続しているかを実装を簡単にするためにSをひっくり返して調べる -S = S[::-1] -sho = [None] * N -sho[0] = 0  # +    A[i + 1] = c -for i, si in enumerate(S): -    if si == ">": +for i in range(len(S) - 1, -1, -1): +    if S[i] == ">": -    sho[i + 1] = c -sho = sho[::-1]  # 元に戻す -# print(dai) -# print(sho) -a = [None] * (N) -for i in range(N): -    a[i] = max(dai[i], sho[i]) -# print(a) -ans = sum(a) -print(ans) +    A[i] = max(A[i], c) +# print(A) +print((sum(A)))