list = gets.chomp.chars.flat_map{|c|[0,c]}+[0]
renzoku = 0
1.step(list.length,2){|i|
  if list[i] == '<'
    renzoku += 1
    list[i+1] = [renzoku,list[i+1]].max
  else
    renzoku = 0
  end
}
list.reverse!
renzoku = 0
1.step(list.length,2){|i|
  if list[i] == '>'
    renzoku += 1
    list[i+1] = [renzoku,list[i+1]].max
  else
    renzoku = 0
  end
}
p list.each_slice(2).map(&:first).inject(:+)