ss=gets.strip.split('')
sq = ss.join('').squeeze

def rle s
  s.each_char.inject([]) do |memo, c| 
     memo.last && c == memo.last.last ? memo.last[0] += 1 : memo << [1, c]
     memo
  end
end

def summ(n)
  (0..n).to_a.inject(:+)
end


rl = rle(ss.join(''))

result=0

if rl.first.last=='>'
  result += summ(rl.first.first)
  rl.shift
end

if rl.length > 0 && rl.last.last=='<'
  result += summ(rl.last.first)
  rl.pop
end

#p rl
rl.map(&:first).each_slice(2){|l,r|
  ll,rr = [l, r].minmax
  result += (summ(ll-1) + summ(rr))
}

p result