s = gets.chomp
up = [0]
down = [0]
tmp = 0

s.each_char do |c|
  c == '<' ? tmp += 1 : tmp = 0
  up << tmp
end

tmp = 0

s.reverse.each_char do |c|
  c == '>' ? tmp += 1 : tmp = 0
  down << tmp
end

size = s.size + 1

puts size.times.map { |i| [up[i], down[size - 1 - i]].max }.inject(:+)