S=eval(input())

S_rev=S[::-1]



import numpy as np



arr_rev=[]

cnt=0

for s_rev in S_rev:

    if s_rev==">":

        cnt+=1

    else:

        cnt=0

    arr_rev.append(cnt)



A=np.array(arr_rev[::-1]+[0])



arr=[]

cnt=0

for s in S:

    if s=="<":

        cnt+=1

    else:

        cnt=0

    arr.append(cnt)



B=np.array([0]+arr)



print((sum(np.maximum(A,B))))
import numpy as np

S=eval(input());T=S[::-1];a=[];c=0

for t in T:

    if t==">":

        c+=1

    else:

        c=0

    a.append(c)

A=np.array(a[::-1]+[0])

b=[];c=0

for s in S:

    if s=="<":

        c+=1

    else:

        c=0

    b.append(c)

B=np.array([0]+b)

print((np.maximum(A,B).sum()))
S = eval(input())
S_rev = S[::-1]
import numpy as np

arr_rev = []
cnt = 0
for s_rev in S_rev:
    if s_rev == ">":
        cnt += 1
    else:
        cnt = 0
    arr_rev.append(cnt)
A = np.array(arr_rev[::-1] + [0])
arr = []
cnt = 0
for s in S:
    if s == "<":
        cnt += 1
    else:
        cnt = 0
    arr.append(cnt)
B = np.array([0] + arr)
print((sum(np.maximum(A, B))))

import numpy as np

S = eval(input())
T = S[::-1]
a = []
c = 0
for t in T:
    if t == ">":
        c += 1
    else:
        c = 0
    a.append(c)
A = np.array(a[::-1] + [0])
b = []
c = 0
for s in S:
    if s == "<":
        c += 1
    else:
        c = 0
    b.append(c)
B = np.array([0] + b)
print((np.maximum(A, B).sum()))

-S = eval(input()) -S_rev = S[::-1] -arr_rev = [] -cnt = 0 -for s_rev in S_rev: -    if s_rev == ">": -        cnt += 1 +S = eval(input()) +T = S[::-1] +a = [] +c = 0 +for t in T: +    if t == ">": +        c += 1 -        cnt = 0 -    arr_rev.append(cnt) -A = np.array(arr_rev[::-1] + [0]) -arr = [] -cnt = 0 +        c = 0 +    a.append(c) +A = np.array(a[::-1] + [0]) +b = [] +c = 0 -        cnt += 1 +        c += 1 -        cnt = 0 -    arr.append(cnt) -B = np.array([0] + arr) -print((sum(np.maximum(A, B)))) +        c = 0 +    b.append(c) +B = np.array([0] + b) +print((np.maximum(A, B).sum()))