import Control.Monad
import Control.Applicative
import Data.Functor
import Data.List
import Data.List.Split
import Data.Char
import Data.Array.IO

readInt = read :: String -> Int
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
-- end of templete

bounds x y 1 = [(a,b) | a <- [0..9], b <- [0..9], abs (x-a) + abs (y-b) <= 1]
bounds x y 2 = [(a,b) | a <- [0..9], b <- [0..9], max (abs (x-a)) (abs (y-b)) <= 1]
bounds x y 3 = [(a,b) | a <- [0..9], b <- [0..9], abs (x-a) + abs (y-b) <= 2]

main = do
    arr <- newArray ((0,0),(9,9)) 0 :: IO (IOUArray (Int,Int) Int)
    map (map readInt . wordsBy (==',')) . lines <$> getContents >>= mapM_ (\[x,y,s] -> forM (bounds x y s) (\p -> (+1) <$> readArray arr p >>= writeArray arr p))
    vl <- map snd <$> getAssocs arr
    print $ length $ filter (==0) vl
    print $ maximum vl