let i = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n') let w = parseInt(i[0]) let h = parseInt(i[1]) let n = parseInt(i[2]) let wl = [] let hl = [] for (let c = 3; c < i.length - 1; c++) { let sk = i[c].split(' ').map((e) => parseInt(e)) if (wl.indexOf(sk[0]) == -1) wl.push(sk[0]) if (hl.indexOf(sk[1]) == -1) hl.push(sk[1]) } console.log(w * h - (w - wl.length) * (h - hl.length) - n)