import qualified Data.ByteString.Char8 as B
import Data.List

readInt :: B.ByteString -> Int
readInt = maybe undefined fst . B.readInt

readIntPairs :: B.ByteString -> [(Int, Int)]
readIntPairs = map (pair . map readInt . B.words) . B.lines

pair :: [t] -> (t, t)
pair [x, y] = (x, y)
pair _ = undefined

main = do
  [h,w,_] <- map read . words <$> getLine
  abs <- readIntPairs <$> B.getContents
  mapM_ print (nurie h w abs)

nurie h w abs = zero : apps
  where
    zero = (h - 2) * (w - 2) - sum apps
    apps = map (pred . length) $ group $ sort $ ([1..9] ++) $ map length $ group $ sort $ concatMap (square h w) abs

square h w (a,b) = [(i,j) | i<-[a-2..a], j<-[b-2..b], i>0, i<=h-2, j>0, j<=w-2]