import Data.List
main = getLine >>= print . solve 0 (5 * 10^5) . map (\g -> (head g, length g)) . group

solve s _ [] = s
solve s p ((c,l):gs)
    | c == '<' = solve (s + sum [1..l]) l gs
    | c == '>' = solve (s + max 0 (l-p) + sum [1..l-1]) 0 gs