s=gets.chomp
s="<"+s if s[0]==">"
s=s+">" if s[s.size-1]=="<"
n=s.size
cnt=0
l,r=0,0
n.times do |i|
  if s[i]=="<"
    l+=1
  else
    r+=1
  end
  if i==n-1 || (s[i]==">" && s[i+1]=="<")
    cnt+=(l*l-l)/2+(r*r-r)/2+[l,r].max
    l,r=0,0
  end
end
p cnt