def main(argv)
  s = gets.chomp
  n = s.size + 1

  a = [0] * n
  s.size.times do |i|
    if s[i] == '<' then
      a[i + 1] = a[i] + 1
    else # s[i] == '>'
      a[i + 1] = a[i] - 1
    end
  end

  bs = []
  j = 0
  (s.size - 1).times do |i|
    if s[i] != s[i + 1] then
      bs.push(a[j..i + 1].dup)
      j = i + 1
    end
  end
  bs.push(a[j...a.size].dup)

  bs.each do |b|
    m = b.min
    if m < 0 then
      b.map!{|x| x += m.abs}
    elsif m > 0 then
      b.map!{|x| x -= m}
    end
  end

  (bs.size - 1).times do |i|
    m = [bs[i][bs[i].size - 1], bs[i + 1][0]].max
    bs[i][bs[i].size - 1] = m
    bs[i + 1][0] = m
  end

  bs.map!{|b| [b.reduce(:+), b[0]]}

  s = bs[0][0]
  (bs.size - 1).times do |i|
    s += bs[i + 1][0] - bs[i + 1][1]
  end
  puts s.to_s
end

if self.to_s == 'main' then
  main(ARGV)
end