import std.stdio, std.string, std.conv, std.array, std.algorithm; import std.uni, std.range, std.math, std.container, std.datetime; import core.bitop; immutable long MOD = 1_000_000_007; void main(){ char[] buf; auto W = readln.chomp.to!ulong; auto H = readln.chomp.to!ulong; auto N = readln.chomp.to!int; auto f_col = new int[](H.to!int); auto f_row = new int[](W.to!int); foreach(lp ; 0 .. N){ readln(buf); auto rd = buf.split.to!(int[]); auto s = rd[0] - 1, k = rd[1] - 1; f_row[s] = 1; f_col[k] = 1; } auto ans = W * H - (W - f_row.sum) * (H - f_col.sum) - N; writeln(ans); }