import Control.Applicative
input = (read :: String -> Int) <$> getLine
toInt = (read :: String -> Int)
solve c n
  | length n > 1 = solve (c+1) $ show $ maximum [(toInt $ take d n)*(toInt $ drop d n) | d <- [1..(length n)-1]]
  | otherwise    = c

aaaa n = if n > 0 then (getLine >>= \x -> putStrLn $ show $ solve 0 x) >> aaaa (n-1) else do return ()
main = input >>= aaaa