S = '>' + eval(input()) + '<='

l = len(S)

A = [0] * (l-2)

zero_posi = []

max_posi = []



for i in range(l-2):

    now = S[i]

    nex = S[i+1]

    if S[i] == '>' and S[i+1] =='<':

        A[i] = 0

        zero_posi.append(i)



while zero_posi:

    start = zero_posi.pop()

    count = 0

    for i in range(start, -1, -1):

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

        count += 1

        if S[i-1] == '<':

            A[i-1] = max(A[i], count)

            break



    count = 0

    for i in range(start, l-2):

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

        count += 1

        if S[i + 1] == '>':

            break



ans = sum(A)

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

l = len(S)

A = [0] * (l+1)



count = 0

for i, s in enumerate(S):

    if s == '>':

        count = 0

    else:

        count += 1

        A[i+1] = count



count = 0

for i in range(l-1, -1, -1):

    s = S[i]

    if s == '<':

        count = 0

    else:

        count += 1

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



print((sum(A)))
S = ">" + eval(input()) + "<="
l = len(S)
A = [0] * (l - 2)
zero_posi = []
max_posi = []
for i in range(l - 2):
    now = S[i]
    nex = S[i + 1]
    if S[i] == ">" and S[i + 1] == "<":
        A[i] = 0
        zero_posi.append(i)
while zero_posi:
    start = zero_posi.pop()
    count = 0
    for i in range(start, -1, -1):
        A[i] = max(A[i], count)
        count += 1
        if S[i - 1] == "<":
            A[i - 1] = max(A[i], count)
            break
    count = 0
    for i in range(start, l - 2):
        A[i] = max(A[i], count)
        count += 1
        if S[i + 1] == ">":
            break
ans = sum(A)
print(ans)

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

-S = ">" + eval(input()) + "<=" +S = eval(input()) -A = [0] * (l - 2) -zero_posi = [] -max_posi = [] -for i in range(l - 2): -    now = S[i] -    nex = S[i + 1] -    if S[i] == ">" and S[i + 1] == "<": -        A[i] = 0 -        zero_posi.append(i) -while zero_posi: -    start = zero_posi.pop() -    count = 0 -    for i in range(start, -1, -1): +A = [0] * (l + 1) +count = 0 +for i, s in enumerate(S): +    if s == ">": +        count = 0 +    else: +        count += 1 +        A[i + 1] = count +count = 0 +for i in range(l - 1, -1, -1): +    s = S[i] +    if s == "<": +        count = 0 +    else: +        count += 1 -        count += 1 -        if S[i - 1] == "<": -            A[i - 1] = max(A[i], count) -            break -    count = 0 -    for i in range(start, l - 2): -        A[i] = max(A[i], count) -        count += 1 -        if S[i + 1] == ">": -            break -ans = sum(A) -print(ans) +print((sum(A)))