S = gets.chomp

array = S.scan(/(<+|>+)/).flatten

number = array.map do |a|
  if a[0] == "<" then
    next (0..a.size).to_a
  end

  next a.size.downto(0).to_a
end

i = 0
result = []
while i < number.size do
  n = number[i]
  if i >= 1 && number[i].size <= number[i-1].size then
    n = n[1..-1]
  end

  if i < number.size - 1 && number[i].size < number[i+1].size then
    n = n[0..-2]
  end
  result << n

  i += 1
end

puts result.flatten.inject(0) {|sum, x| sum + x}