arr = gets.chomp.split('')
prev = arr[0]
index = 0
list = []
(1..arr.count).each do |i|
  if i < arr.count
    if prev + arr[i] == '><'
      list << arr.slice(index...i)
      index = i
    end
    prev = arr[i]
  else
    list << arr.slice(index...i)
  end
end
sum = 0
list.each do |i|
  l = i.count('<')
  r = i.count - l
  sum += (l + 1) * l / 2
  sum += (r + 1) * r / 2
  sum -= [l, r].min
end
puts sum