s = gets.chomp.split(//)

ans = 0
nums = Array.new(s.size+1, nil)
nums[0] = 0
migi = s[0] == '>'
ren = 0
minimum = 0

(0..(s.size-1)).each do |i|
  if s[i] == '>'
    unless migi
      minimum = nums[i]
    end
    nums[i+1] = nums[i]-1
    migi = true
    ren += 1
  else
    if migi # ターンした
      # p [ren, minimum]
      if nums[i] != 0
        ((i-ren)..i).each do |j|
          nums[j] -= nums[i]
        end
        nums[i-ren] = [nums[i-ren], minimum].max
      end
      migi = false
      ren = 0
    end
    nums[i+1] = nums[i]+1
  end
  # p nums
end

i = s.size
if migi # ターンした
  if nums[i] != 0
    ((i-ren)..i).each do |j|
      nums[j] -= nums[i]
    end
    nums[i-ren] = [nums[i-ren], minimum].max
  end
  migi = false
  ren = 0
  # p nums
end


puts nums.inject(:+)

# < >>> << > <<<<< >>> <
# 0,3,2,1,0,1,2,0,1,2,3,4,5,2,1,0,1
