import Data.List

main :: IO ()
main = do
  l1 <- getLine
  let s1 = l1
  print $ f s1

f [] = 0
f s = g n + g m - min n m + f s3
  where
    (s1, s') = span (=='<') s
    (s2, s3) = span (=='>') s'
    (n, m) = (length s1, length s2)

g n = (n*(n+1))`div`2