s = gets.chomp.chars
a = Array.new(s.size + 1, 0)
m = 0
s.each_with_index do |x, i|
  if x == '<'
    if m > 0
      m.next.times do |j|
        a[i - j] = [a[i - j], j].max
      end
      m = 0
    end
    a[i + 1] = a[i] + 1
  else
    m += 1
  end
end
if m > 0
  m.next.times do |j|
    a[-1 - j] = j
  end
  m = 0
end
puts a.inject(:+)