let [|h; w; q|] = stdin.ReadLine().Split " " |> Array.map int let mutable available = (int64 h) * (int64 w) let mutable M = Map.empty for _ in 0..q-1 do let [|y; x|] = stdin.ReadLine().Split " " |> Array.map int let minus = if Map.containsKey (x-1) M then let m = M.[x-1] - y if m < 0 then 0 else M <- M.Add (x-1, y) m else M <- M.Add (x-1, y) (h+1) - y available <- available - (int64 minus) printfn "%d" available // let arr = // [| // for i in 0..q-1 -> // let [|y; x|] = stdin.ReadLine().Split " " |> Array.map int // x, y // |] |> Array.sort |> Array.rev // // let rec count prev_x value index = // if index = arr.Length then // value // else // let x, y = arr.[index] // if prev_x <> x then // count x (value+y) (index+1) // else // count x value (index+1) // // count -1 0 0 |> printfn "%d"