using System;

namespace _200125___Boje
{
    class Program
    {
        static void Main(string[] args)
        {
            int N, M, K, i, j, l, nBB;
            string[] str;
            str = Console.ReadLine().Split();
            N = int.Parse(str[0]);
            M = int.Parse(str[1]);
            K = int.Parse(str[2]);

            int[,] MAT = new int[N + 2, M + 2];
            for (i = 1; i <= N; i++)
            {
                for (j = 1; j <= M; j++)
                {
                    MAT[i, j] = 1;
                }
            }
            for (l = 1; l <= K; l++)
            {
                str = Console.ReadLine().Split();
                i = int.Parse(str[0]);
                j = int.Parse(str[1]);
                MAT[i, j] = 0;
            }
            for (i = 0; i <= N; i++)
            {
                MAT[i, 0] = 0;
                MAT[i, M + 1] = 0;
            }
            for (j = 0; i <= M; i++)
            {
                MAT[0, j] = 0;
                MAT[N + 1, j] = 0;
            }
            nBB = 0;
            for (i = 1; i <= N; i++)
            {
                for (j = 1; j <= M; j++)
                {
                    if (MAT[i, j] == 1)
                    {
                        if ((MAT[i - 1, j] == 0) && (MAT[i, j - 1] == 0))
                        {
                            if ((MAT[i + 1, j] == 2) || (MAT[i, j + 1] == 2))
                            {

                            }
                            else
                            {
                                nBB++;
                            }
                        }
                        MAT[i, j] = 2;
                        if (MAT[i - 1, j] != 0)
                        {
                            MAT[i - 1, j] = 2;
                        }
                        if (MAT[i + 1, j] != 0)
                        {
                            MAT[i + 1, j] = 2;
                        }
                        if (MAT[i, j - 1] != 0)
                        {
                            MAT[i, j - 1] = 2;
                        }
                        if (MAT[i, j + 1] != 0)
                        {
                            MAT[i, j + 1] = 2;
                        }
                    }
                }
            }
            Console.WriteLine(Convert.ToString(nBB));
        }
    }
}