=begin
戦略：連続する<<< >>>ごとに区切る。また、区切り> <は必ず0になる
=end

s = gets.chomp
n = s.size

sum = 0
n = 0
count = 0
state = true

s.each_char do |c|
  if (c == '<') === state
    count += 1
  else
    if state
      n = count
    else
      sum += n * (n + 1) / 2
      sum += count * (count + 1) / 2
      sum -= [n, count].min
    end
    state = !state
    count = 1
  end
end

if state
  sum += count * (count + 1) / 2
else
  sum += n * (n + 1) / 2
  sum += count * (count + 1) / 2
  sum -= [n, count].min
end

puts sum