s=eval(input())

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

Z=[]

scount=0

ans=0



if s[0]=="<":

  d[1]=d[0]+1

for i in range(1,len(s)-1):

  if s[i]==">":

    d[i+1]=0

    scount+=1

    Q=scount

    X=i

    if s[i-1]=="<":

      Z.append(i)

  elif s[i]=="<":

    d[i+1]=d[i]+1

    for j in range(scount):

      d[i-scount+j]=(scount-j)

    scount=0



if s[-1]==">":

  d[-1]=0

  scount+=1

  Q=scount

  X=len(s)-1    

if scount>0:

  for j in range(scount):

    d[X-scount+j+1]=Q

    Q-=1

for i in Z:

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

  if i==0 and s[0]=="<":

    d[i]=0

if s[-1]=="<":

  d[-1]=d[-2]+1

if s[0]==">":

  d[0]=d[1]+1



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

n=len(s)

ans=[0]*(n+1)

  

for i in range(0,n):

  if s[i]=='<':

    ans[i+1]=ans[i]+1

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

  if s[i]=='>':

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

print((sum(ans)))
s = eval(input())
d = [0] * (len(s) + 1)
Z = []
scount = 0
ans = 0
if s[0] == "<":
    d[1] = d[0] + 1
for i in range(1, len(s) - 1):
    if s[i] == ">":
        d[i + 1] = 0
        scount += 1
        Q = scount
        X = i
        if s[i - 1] == "<":
            Z.append(i)
    elif s[i] == "<":
        d[i + 1] = d[i] + 1
        for j in range(scount):
            d[i - scount + j] = scount - j
        scount = 0
if s[-1] == ">":
    d[-1] = 0
    scount += 1
    Q = scount
    X = len(s) - 1
if scount > 0:
    for j in range(scount):
        d[X - scount + j + 1] = Q
        Q -= 1
for i in Z:
    d[i] = max(d[i + 1] + 1, d[i - 1] + 1)
    if i == 0 and s[0] == "<":
        d[i] = 0
if s[-1] == "<":
    d[-1] = d[-2] + 1
if s[0] == ">":
    d[0] = d[1] + 1
print((sum(d)))

s = eval(input())
n = len(s)
ans = [0] * (n + 1)
for i in range(0, n):
    if s[i] == "<":
        ans[i + 1] = ans[i] + 1
for i in range(n - 1, -1, -1):
    if s[i] == ">":
        ans[i] = max(ans[i + 1] + 1, ans[i])
print((sum(ans)))

-d = [0] * (len(s) + 1) -Z = [] -scount = 0 -ans = 0 -if s[0] == "<": -    d[1] = d[0] + 1 -for i in range(1, len(s) - 1): +n = len(s) +ans = [0] * (n + 1) +for i in range(0, n): +    if s[i] == "<": +        ans[i + 1] = ans[i] + 1 +for i in range(n - 1, -1, -1): -        d[i + 1] = 0 -        scount += 1 -        Q = scount -        X = i -        if s[i - 1] == "<": -            Z.append(i) -    elif s[i] == "<": -        d[i + 1] = d[i] + 1 -        for j in range(scount): -            d[i - scount + j] = scount - j -        scount = 0 -if s[-1] == ">": -    d[-1] = 0 -    scount += 1 -    Q = scount -    X = len(s) - 1 -if scount > 0: -    for j in range(scount): -        d[X - scount + j + 1] = Q -        Q -= 1 -for i in Z: -    d[i] = max(d[i + 1] + 1, d[i - 1] + 1) -    if i == 0 and s[0] == "<": -        d[i] = 0 -if s[-1] == "<": -    d[-1] = d[-2] + 1 -if s[0] == ">": -    d[0] = d[1] + 1 -print((sum(d))) +        ans[i] = max(ans[i + 1] + 1, ans[i]) +print((sum(ans)))