str = gets.chomp.split('')
t = 0
l_t = [0]
str.each do |s| 
    if s == '<'
        t += 1
    else
        t = 0
    end
    l_t << t
end
t = 0
r_t = [0]
str.reverse.each do |s|
    if s == '>'
        t += 1
    else
        t = 0
    end
    r_t.unshift(t)
end
ans = 0
0.upto(str.size) do |i|
    
    ans += [l_t[i], r_t[i]].max
end

puts ans