s = gets.chomp
n = s.size + 1

t = 0
l_r = [t]
(0...s.size).each do |i|
  if s[i] == '<'
    t += 1
  else
    t = 0
  end
  l_r << t
end

t = 0
r_r = [t]
(s.size-1).downto(0) do |i|
  if s[i] == '>'
    t += 1
  else
    t = 0
  end
  r_r.unshift(t)
end

ans = 0
(0...n).each do |i|
  ans += [l_r[i], r_r[i]].max
end

puts ans