s = gets.chomp
cum_up = [0]
cum_down = [0]
tmp = 0

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

tmp = 0

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

size = s.size

puts size.times.map { |i| [cum_down[i], cum_up[size - i]].max }.inject(:+)