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