s=gets.chomp

n=s.length+1
a=Array.new(n+1,0)
a[0]=0
count=0
(n-1).times do |i|
    if s[i]==">"
        count+=1
        a[i+1]=a[i]
    else
        count.times do |j|
            a[i]+=(j+1)
        end
        a[i+1]=a[i]+1
    end
end
count.times do |j|
    a[n]+=(j+1)
end
puts a[n]
