import re

s = str(input())

s = re.sub('><', '>,0,<', s)

if s[0] == '<' :
  s = '0,' + str(s)
  
if s[-1] == '>' :
  s = str(s) + ',0'
  
s = re.sub('<>', '<,>', s) 

s = s.split('0')

sum = 0

for i in s:
  i = i.split(',')
  cnt = 0
  for j in range(len(i)):
    Len = int(len(i[j]))
    cnt = cnt + 1
    sum = sum + Len * (Len + 1) / 2
    if cnt > 3:
      des = min([len(i[1]),len(i[2])])
      sum = sum - des
    
print(int(sum))