package main import ( "fmt" ) func main() { var w, h, n int64 fmt.Scan(&w, &h, &n) ms := make(map[int64]bool) mk := make(map[int64]bool) for i := int64(0); i < n; i++ { var s, k int64 fmt.Scan(&s, &k) ms[s] = true mk[k] = true } sum := int64(0) sum = int64(len(ms)) * h + int64(len(mk)) * w - int64(len(mk)) * int64(len(ms)) - n fmt.Println(sum) }