import Control.Monad
import Data.Array.Unboxed
import qualified Data.Map.Strict as M

main = join $ sub <$> get

sub [h,w,n] = sol h w n <$> replicateM n get >>= put

get = fmap read . words <$> getLine

put = mapM_ print

sol h w n ps = if n>0 then s:elems sm else replicate 10 0
  where
  m = M.fromListWith (+) $ zip
    (concatMap (\[a,b] -> range ((a-1,b-1),(a+1,b+1))) ps)
    (repeat 1) :: M.Map (Int, Int) Int
  sm = accumArray (+) 0 (1,9) $ 
    [(v, 1) | (k,v) <- M.assocs m, inRange ((2,2),(h-1,w-1)) k] :: UArray Int Int
  s = length . filter (not . flip M.member m) $ range ((2,2),(h-1,w-1))
