def max(a, b)
  a > b ? a : b
end

L = '>' # >
R = '<' # <

arr = gets.chomp.split('')

targets = []

last_dir = R
count = -1
arr.each do |dir|
  if last_dir == dir
    count += 1
    next
  end

  targets << count + 1
  if dir == L
    targets << nil
  end
  last_dir = dir
  count = 0
end

if last_dir = L
  targets << count + 1
else
  targets << count + 2
end


counter = 0
targets.each_with_index do |num, index|
  if num.nil?
    add = max(targets[index - 1], targets[index + 1])
  else
    add = (num * (num - 1)) / 2
  end
  counter += add
end

puts counter