func main() var w: int :: cui@inputInt() var h: int :: cui@inputInt() var n: int :: cui@inputInt() var s: []int :: #[n]int var k: []int :: #[n]int for i(0, n - 1) do s[i] :: cui@inputInt() do k[i] :: cui@inputInt() end for var ms: dict :: #dict var mk: dict :: #dict for i(0, n - 1) do ms.add(s[i], true) do mk.add(k[i], true) end for var ns: int :: ^ms var nk: int :: ^mk var ans: int :: ns * nk - n + (w - ns) * nk + (h - nk) * ns do cui@print("\{ans}\n") end func