using System; using System.Collections.Generic; using System.Linq; namespace yukicoder { public class Program { public static void Main() { var h = int.Parse(Console.ReadLine()); var w = int.Parse(Console.ReadLine()); var n = int.Parse(Console.ReadLine()); var s = new int[n]; var k = new int[n]; for(var i= 0; i < n; i++) { var a = Console.ReadLine().Split(' ').Select(value => int.Parse(value) - 1).ToArray(); s[i] = a[0]; k[i] = a[1]; } var ss = s.Distinct(); var kk = k.Distinct(); Console.WriteLine(h * w - (w - kk.Count()) * (h - ss.Count()) - n); } } }