S = gets

a_c = S.chars
i = 0
sum = []


p a_c.length

a_c.each do |th|
  n = 0
  x = 0
  
  if i == 0
    if th == '<'
      sum.push(0)
      i += 1
    else
      while a_c[i] == '>'
        n += 1
      end
      n.times do
        sum.push(n-x)
        x += 1
        i += 1
      end
    end
  else
    if a_c[i] == '<'
      #x = sum[i].to_i + 1
      while a_c[i] == '<'
        p "'<' #{i}kaime push=#{x}"
        sum.push(x)
        x += 1
        i += 1
      end
    else
      while a_c[i] == '>'
        n += 1
        i += 1
      end
      n.times do
        if sum[i-n].to_i >= n
          p "#{i} #{sum[i-n]}"
        else
          p "'>' #{i-n+x}kaime push=#{n-x}"
          sum.push(n-x)
          x += 1
        end
      end
    end
  end
end

p "sum=#{sum}, i=#{i}"

ans = 0

sum.each do |s|
  ans += s
end

p ans