s = gets.chomp
s += "<"
sum = 0
prev_dir = s[0]
run = 0
prev_run = 0
for i in 0...s.length do
  if s[i] == prev_dir
    run += 1
  else
    if s[i] == "<"
      if prev_run < run
        sum += (prev_run - 1) * prev_run / 2
        sum += run * (run + 1) / 2
      else
        sum += prev_run * (prev_run + 1) / 2
        sum += (run - 1) * run / 2
      end
    end
    prev_run = run
    run = 1
  end
#  puts "#{prev_run} #{run} #{prev_dir} #{s[i]} #{sum}"
  prev_dir = s[i]
end
sum += (run - 1) * run / 2
puts sum
