using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Magatro { static void Main() { int W = int.Parse(Console.ReadLine()); int H = int.Parse(Console.ReadLine()); int N = int.Parse(Console.ReadLine()); int[] S = new int[N]; int[] K = new int[N]; HashSet HashS = new HashSet(),HashK=new HashSet(); for(int i = 0; i < N; i++) { int[] q = Console.ReadLine().Split(' ').Select(s=>int.Parse(s)).ToArray(); HashS.Add(q[0]); HashK.Add(q[1]); S[i] =q[0]; K[i] = q[1]; } long All = W * H; long scnt = W - HashS.Count; long kcnt = H - HashK.Count; long cnt = scnt * kcnt + S.Length; Console.WriteLine(All - cnt); } }