S = eval(input())

snum = len(S)

N = snum +1

Nar = [0 for i in range(N)]



for i in range(snum):

    if S[i] == '<':

        Nar[i+1] = Nar[i] + 1



for i in reversed(list(range(N-1))):

    if S[i] == '>':

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

sum = 0

for i in Nar:

    sum += i

print(sum)
S = eval(input())

ans = 0

a = []

up = True

count = 0

for i in S:

    if up:

        if i == '>':

            a.append(count)

            count = 1

            up = False

        else:

            count += 1

    else:

        if i == '<':

            a.append(count)

            count = 1

            up = True

        else:

            count += 1

a.append(count)

if len(a)%2 == 1:

    a.append(0)

for i in range(0,len(a),2):

    u,d = max(a[i],a[i+1]), min(a[i],a[i+1])-1

    ans += u*(u+1)//2 + d*(d+1)//2

print(ans)

    
S = eval(input())
snum = len(S)
N = snum + 1
Nar = [0 for i in range(N)]
for i in range(snum):
    if S[i] == "<":
        Nar[i + 1] = Nar[i] + 1
for i in reversed(list(range(N - 1))):
    if S[i] == ">":
        Nar[i] = max(Nar[i], Nar[i + 1] + 1)
sum = 0
for i in Nar:
    sum += i
print(sum)

S = eval(input())
ans = 0
a = []
up = True
count = 0
for i in S:
    if up:
        if i == ">":
            a.append(count)
            count = 1
            up = False
        else:
            count += 1
    else:
        if i == "<":
            a.append(count)
            count = 1
            up = True
        else:
            count += 1
a.append(count)
if len(a) % 2 == 1:
    a.append(0)
for i in range(0, len(a), 2):
    u, d = max(a[i], a[i + 1]), min(a[i], a[i + 1]) - 1
    ans += u * (u + 1) // 2 + d * (d + 1) // 2
print(ans)

-snum = len(S) -N = snum + 1 -Nar = [0 for i in range(N)] -for i in range(snum): -    if S[i] == "<": -        Nar[i + 1] = Nar[i] + 1 -for i in reversed(list(range(N - 1))): -    if S[i] == ">": -        Nar[i] = max(Nar[i], Nar[i + 1] + 1) -sum = 0 -for i in Nar: -    sum += i -print(sum) +ans = 0 +a = [] +up = True +count = 0 +for i in S: +    if up: +        if i == ">": +            a.append(count) +            count = 1 +            up = False +        else: +            count += 1 +    else: +        if i == "<": +            a.append(count) +            count = 1 +            up = True +        else: +            count += 1 +a.append(count) +if len(a) % 2 == 1: +    a.append(0) +for i in range(0, len(a), 2): +    u, d = max(a[i], a[i + 1]), min(a[i], a[i + 1]) - 1 +    ans += u * (u + 1) // 2 + d * (d + 1) // 2 +print(ans)