s = gets.chomp.chars
a = Array.new(s.size + 1, 0)

cnt = 0
s.chunk{|c| c }.each do |c, items|
  l = items.length
  if c == "<"
    a[cnt] = 0
    1.step(l) do |i|
      a[cnt + i] = a[cnt] + i
    end
  else
    a[cnt + l] = 0
    1.step(l) do |i|
      a[cnt + l - i] = [a[cnt + l] + i, a[cnt + l - i]].max
    end
  end
  cnt += l
end
puts a.inject(:+)