s = str(eval(input()))

n = len(s)

cnt = 0

l = []

for i in range(n):

    l.append(cnt)

    if s[i] == '<':

        cnt += 1

    else:

        cnt = 0

else:

    l.append(cnt)

#print(l)



r = []

cnt = 0

for i in reversed(list(range(n))):

    r.append(cnt)

    if s[i] == '>':

        cnt += 1

    else:

        cnt = 0

else:

    r.append(cnt)

r.reverse()

#print(r)



A = [0]*len(l)

for i in range(len(A)):

    A[i] = max(l[i], r[i])

print((sum(A)))

s = str(eval(input()))



n = len(s)



L = [0]*(n+1)

cnt = 0

for i in range(n):

    if s[i] == '<':

        cnt += 1

    else:

        cnt = 0

    L[i+1] = cnt





R = [0]*(n+1)

cnt = 0

for i in reversed(list(range(n))):

    if s[i] == '>':

        cnt += 1

    else:

        cnt = 0

    R[i] = cnt



A = [0]*(n+1)

for i in range(n+1):

    A[i] = max(L[i], R[i])

print((sum(A)))

s = str(eval(input()))
n = len(s)
cnt = 0
l = []
for i in range(n):
    l.append(cnt)
    if s[i] == "<":
        cnt += 1
    else:
        cnt = 0
else:
    l.append(cnt)
# print(l)
r = []
cnt = 0
for i in reversed(list(range(n))):
    r.append(cnt)
    if s[i] == ">":
        cnt += 1
    else:
        cnt = 0
else:
    r.append(cnt)
r.reverse()
# print(r)
A = [0] * len(l)
for i in range(len(A)):
    A[i] = max(l[i], r[i])
print((sum(A)))

s = str(eval(input()))
n = len(s)
L = [0] * (n + 1)
cnt = 0
for i in range(n):
    if s[i] == "<":
        cnt += 1
    else:
        cnt = 0
    L[i + 1] = cnt
R = [0] * (n + 1)
cnt = 0
for i in reversed(list(range(n))):
    if s[i] == ">":
        cnt += 1
    else:
        cnt = 0
    R[i] = cnt
A = [0] * (n + 1)
for i in range(n + 1):
    A[i] = max(L[i], R[i])
print((sum(A)))

+L = [0] * (n + 1) -l = [] -    l.append(cnt) -else: -    l.append(cnt) -# print(l) -r = [] +    L[i + 1] = cnt +R = [0] * (n + 1) -    r.append(cnt) -else: -    r.append(cnt) -r.reverse() -# print(r) -A = [0] * len(l) -for i in range(len(A)): -    A[i] = max(l[i], r[i]) +    R[i] = cnt +A = [0] * (n + 1) +for i in range(n + 1): +    A[i] = max(L[i], R[i])