buf = $stdin.gets.chop

ary = [0]
buf.each_char do |ch|
  ary << ((ch == "<") ? ary[-1]+1 : 0)
end
(ary.size-2).downto(0) do |i|
  if buf[i] == ">" then
    ary[i] = [ary[i], ary[i+1]+1].max
  end
end

puts ary.inject(:+)