s = gets.chomp
n = s.size
num = Array.new(n+1,0)

j = 0
k = 0
k += 1 while k < n && s[k] == ">"
(n+1).times do |i|

    if k == 0
        k += 1 while i + k < n && s[i+k] == ">"
    end

    num[i] = j > k ? j : k

    k -= 1 if k > 0
    j += s[i] == "<" ? 1 : -j
end

#p num
puts num.inject(:+)