s=eval(input())

a=[0]*(len(s)+1)

r=0

l=0

for i in range(len(a)):

  j=i

  if r==0:

    while j < len(s) and s[j] == '>':

      r+=1

      j+=1

  else:

    r-=1

  if i !=0 and s[i-1] == '<':

    l+=1

  else:

    l=0

  a[i]=max(l,r)

print((sum(a)))
s=eval(input())

# ai=max(左にある<の連続数,右にある>の連続数)

n=len(s)+1

dr,dl=[0]*n,[0]*n

# dl[i]:区切りiの左にある<の連続数。dl[0]=0

# dr[i]:区切りiの右にある>の連続数。dl[-1]=0

# ともにlen=n

p=''

cl,cr=0,0

for i in range(n-1):

      if s[i]=='<':

            cl+=1

      else:

            cl=0

      dl[i+1]=cl

      if s[-(i+1)]=='>':

            cr+=1

      else:

            cr=0

      dr[-(i+2)]=cr

ans=0

for i in range(n):

      ans+=max(dl[i],dr[i])

print(ans)

s = eval(input())
a = [0] * (len(s) + 1)
r = 0
l = 0
for i in range(len(a)):
    j = i
    if r == 0:
        while j < len(s) and s[j] == ">":
            r += 1
            j += 1
    else:
        r -= 1
    if i != 0 and s[i - 1] == "<":
        l += 1
    else:
        l = 0
    a[i] = max(l, r)
print((sum(a)))

s = eval(input())
# ai=max(左にある<の連続数,右にある>の連続数)
n = len(s) + 1
dr, dl = [0] * n, [0] * n
# dl[i]:区切りiの左にある<の連続数。dl[0]=0
# dr[i]:区切りiの右にある>の連続数。dl[-1]=0
# ともにlen=n
p = ""
cl, cr = 0, 0
for i in range(n - 1):
    if s[i] == "<":
        cl += 1
    else:
        cl = 0
    dl[i + 1] = cl
    if s[-(i + 1)] == ">":
        cr += 1
    else:
        cr = 0
    dr[-(i + 2)] = cr
ans = 0
for i in range(n):
    ans += max(dl[i], dr[i])
print(ans)

-a = [0] * (len(s) + 1) -r = 0 -l = 0 -for i in range(len(a)): -    j = i -    if r == 0: -        while j < len(s) and s[j] == ">": -            r += 1 -            j += 1 +# ai=max(左にある<の連続数,右にある>の連続数) +n = len(s) + 1 +dr, dl = [0] * n, [0] * n +# dl[i]:区切りiの左にある<の連続数。dl[0]=0 +# dr[i]:区切りiの右にある>の連続数。dl[-1]=0 +# ともにlen=n +p = "" +cl, cr = 0, 0 +for i in range(n - 1): +    if s[i] == "<": +        cl += 1 -        r -= 1 -    if i != 0 and s[i - 1] == "<": -        l += 1 +        cl = 0 +    dl[i + 1] = cl +    if s[-(i + 1)] == ">": +        cr += 1 -        l = 0 -    a[i] = max(l, r) -print((sum(a))) +        cr = 0 +    dr[-(i + 2)] = cr +ans = 0 +for i in range(n): +    ans += max(dl[i], dr[i]) +print(ans)