s = gets.chomp
n = s.length
ans = [0]*(n+1)

i = 0
while i < n
  if s[i] == "<"
    while i < n && s[i] == "<"
      ans[i+1] = ans[i] + 1
      i += 1
    end
  else
    i += 1
  end
end

i = n-1
while i >= 0
  if s[i] == ">"
    while i >= 0 && s[i] == ">"
      ans[i] = [ans[i],ans[i+1] + 1].max
      i -= 1
    end
  else
    i -= 1
  end
end

#p ans
p ans.inject(:+)