s = gets.chomp
larger_than_left = [0]
consecutive = 0
s.each_char.with_index do |c|
  consecutive = c == "<" ? consecutive + 1 : 0
  larger_than_left.push(consecutive)
end
larger_than_right = [0]
consecutive = 0
s.reverse.each_char do |c|
  consecutive = c == ">" ? consecutive + 1 : 0
  larger_than_right.unshift(consecutive)
end
ans = 0
(s.size + 1).times { |i| ans += [larger_than_left[i], larger_than_right[i]].max }
puts ans
