s = gets.chomp
n = s.length + 1
a = Array.new(n, 0)
0.upto(n - 2) do |i|
  if s[i] == "<"
    a[i + 1] = [a[i] + 1, a[i + 1]].max
  end
end
(n - 2).downto(0) do |i|
  if s[i] == ">"
    a[i] = [a[i], a[i + 1] + 1].max
  end
end
puts a.reduce(0) { |sum, v| sum += v }
