# frozen_string_literal: true

s = gets.chomp.chars
b = s.chunk { |e| e == '<' }.map { |e| e[1].size }
b.push 0
b.push 0 if s[-1] == '>'
a = []
dflag = true
if s[0] == '<'
  a = (0...b[0]).to_a
  a.push [b[0], b[1]].max
else
  dflag = false
  a = (0..b[0]).to_a.reverse
end
(1...(b.size)).each do |i|
  if dflag
    (b[i] - 1).downto(0).each do |j|
      a.push j
    end
  else
    (1...b[i]).each do |j|
      a.push j
    end
    a.push [b[i], b[i + 1]].max
  end
  dflag = !dflag
end
puts a.reduce(:+)
