import std.algorithm, std.array, std.container, std.range; import std.string, std.conv, std.math; import std.stdio, std.typecons; alias Tuple!(int, "s", int, "k") card; void main() { auto w = readln.chomp.to!int; auto h = readln.chomp.to!int; auto n = readln.chomp.to!int; auto ci = iota(n).map!((i) { auto rd = readln.split.map!(to!int); return card(rd[0], rd[1]); }).array; auto s = ci.map!(c => c.s).uniq.array.length; auto k = ci.map!(c => c.k).uniq.array.length; writeln(w * k + s * h - s * k - ci.length); }