s=gets.chomp

n=s.length+1
count_l=Array.new(n,0)
count_r=Array.new(n,0)

count=0
(n-1).times do |i|
    if s[i]=="<"
        count+=1
    else
        count=0
    end
    count_l[i+1]=count
end

count=0
(n-2).downto(0) do |i|
    if s[i]==">"
        count+=1
    else
        count=0
    end
    count_r[i]=count
end

ans=0
n.times do |i|
    ans+=[count_l[i],count_r[i]].max
end
puts ans
