import Control.Monad
import Control.Applicative

main :: IO ()
main = do
  [a, b] <- getInts
  if (a == 0 && b == 0) then return ()
  else do
    n <- getInt
    ss <- getIntsLines n
    print $ solve [1,1] (ss ++ [[a+1, x] | x <- [1..b]] ++ [[x,b+1]|x<-[1..a]]) a b
    main

solve p ss a b 
  | p == [a,b] = 1
  | notElem (add1 p) ss && notElem (add2 p) ss = solve (add1 p) ss a b + solve (add2 p) ss a b
  | elem (add1 p) ss && notElem (add2 p) ss = solve (add2 p) ss a b
  | notElem (add1 p) ss && elem (add2 p) ss = solve (add1 p) ss a b
  | otherwise = 0



---

getInt :: IO Integer
getInt = read <$> getLine

getInts :: IO [Integer]
getInts = map read . words <$> getLine

getIntLines :: Integral a => a -> IO [Integer]
getIntLines n = replicateM (fromIntegral n :: Int) getInt

getIntsLines :: Integral a => a -> IO [[Integer]]
getIntsLines n = replicateM (fromIntegral n :: Int) getInts

add1 [n,m] = [n + 1, m]
add2 [n,m] = [n, m + 1]