S = gets.chomp.chars

nums = Array.new(S.size + 1, -1)

chain = 0

S.each_with_index do |s, idx|
  if s == '<'
    nums[idx] = chain
    nums[idx + 1] = chain + 1
    chain += 1
  else
    chain = 0
  end
end

# p nums
N = S.size
chain = 0

S.reverse.each_with_index do |s, idx|
  if s == '>'
    nums[N - idx] = chain
    nums[N - idx - 1] = [nums[N - idx - 1],  chain + 1].max
    chain += 1
  else
    if S[N - idx - 1] == '>' && nums[N - idx - 1] >= chain
      # nums[N - idx] = chain + 1
    end

    chain = 0
  end
end

# p nums
puts nums.inject(:+)
