import qualified Data.ByteString.Char8 as BS

readString = map BS.unpack . BS.words

getString = readString <$> BS.getLine

calc :: String -> Int
calc [] = 0
calc ss = k + calc ss''
  where
    len_ss = length ss
    ss' = ss `seq` dropWhile (== '<') ss
    len_ss' = len_ss - length ss'
    ss'' = ss' `seq` dropWhile (== '>') ss'
    len_ss'' = length ss' - length ss''
    k = len_ss' `seq` len_ss'' `seq` sum [0 .. maximum [len_ss' - 1, 0]] + sum [0 .. maximum [len_ss'' - 1, 0]] + maximum [len_ss', len_ss'']

main = do
  [s] <- getString
  print $ calc s
