S = gets.chomp
arr = []
curr = 0
S.scan(/(<+)|(>+)/){
  size = $&.size
  if $1
    size.times{|i|
      arr << i
    }
    curr = size
  else
    arr << [curr, size].max
    (size-1).downto(1){|i|
      arr << i
    }
    curr = 0
  end
}
case S[-1]
when ?<
  arr << curr
when ?>
  arr << 0
end

p arr.inject:+