S = gets.chomp!

lefts = Array.new(S.size + 1, 0)
S.each_char.with_index do |c, i|
  if c == '<'
    lefts[i+1] = lefts[i] + 1
  end
end

rights = Array.new(S.size + 1, 0)

S.each_char.reverse_each.with_index do |c, i|
  if c == '>'
    rights[i+1] = rights[i] + 1
  end
end

rights.reverse!
ans = 0
(S.size + 1).times do |i|
  ans += [lefts[i], rights[i]].max
end

puts ans
