io = STDIN
str=io.gets.chomp
chunk=str.split(//).chunk_while{|a,b|a==b}.map{|a|[a[0],a.size]}.to_a
st=0
ar=[]
chunk.each do |a|
  if a[0]=="<"
    a[1].times do |i|
      ar<<i
    end
    st =ar[-1]+1
  elsif a[0]==">"
    init=[st,a[1]].max
    ar<<init
    (a[1]-1).times do |i|
      ar<<a[1]-i-1
    end
    st=ar[-1]-1
  end
end
ar << st
p ar.inject(:+)
