s = gets.chomp.to_s
ary = s.split(//)

suretsu = []
suretsu[0] = 0

ary.each do |i|
    if i == ">"
        suretsu << suretsu[-1] - 1
    else
        suretsu << suretsu[-1] + 1
    end
end

add_number = suretsu.min

if ary[0] == "<"
    suretsu[0] = add_number
else ary[-1] == ">"
    suretsu[-1] = add_number
end

ans = 0

suretsu.each do |i|
    i = i + add_number.abs
    ans = ans + i
end

puts ans