open System let ri () = stdin.ReadLine() |> int let ria () = stdin.ReadLine().Split() |> Array.map int type Sol() = member this.Solve() = let W = stdin.ReadLine() |> int64 let H = stdin.ReadLine() |> int64 let N = stdin.ReadLine() |> int let mutable (L : list ) = [] for i in 1..(int N) do let (s,k) = (ria () ) |> (fun ar -> (ar.[0], ar.[1]) ) L <- (s,k) :: L let hu = L |> List.map fst |> List.distinct |> List.length |> int64 let wu = L |> List.map snd |> List.distinct |> List.length |> int64 W*H - (W-wu)*(H-hu) - (int64 N) |> printfn "%d" let mySol = new Sol() mySol.Solve()