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

n = s.size + 1
n.times do |i|
  if i == 0
    # a[0] = 0 if s[i] == "<"
    next
  else
    if s[i-1] == "<"
      a[i] = a[i-1] + 1
    end
  end
end
# p a
(n-1).downto(0) do |i|
  if i == n-1
    next
  else
    if s[i] == ">"
      a[i] = a[i+1] + 1 if a[i+1] + 1 > a[i]
    end
  end
end
# p a
p a.inject(&:+)
  
