INCREASE = '<'

s = gets.chomp.split('')
n = s.length + 1
a = Array.new(n, nil)
prev = ''
top_index = nil
s.each_with_index do |t, i|
  if t == prev
    if t == INCREASE
      a[i+1] = a[i]+1
    else
      # top_index += 1
    end
  else
    if t == INCREASE
      a[i] = 0
      a[i+1] = 1
      if top_index
        (top_index..i-1).reverse_each do |j|
          a[j] = a[j+1] + 1
        end
        if a[top_index - 1] == a[top_index]
          a[top_index] = a[top_index] + 1
        elsif a[top_index - 1] > a[top_index]
          a[top_index] = a[top_index-1] + 1
        end
      end
    else
      top_index = i.zero? ? 0 : i
    end
  end
  if i == n - 2 && t != INCREASE
    a[i+1] = 0
    if top_index
      (top_index..i).reverse_each do |j|
        a[j] = a[j+1] + 1
      end
    end
  end
  prev = t
end
puts a.sum