#include typedef long long ll; int w, h, n; bool isW[1000001], isH[1000001]; ll all; int main(){ std::cin >> w >> h >> n; all = w * h; for (int i = 0; i < n; i++){ int a, b; std::cin >> a >> b; a--, b--; isW[a] = true; isH[b] = true; } int cntW = 0, cntH = 0; for (int i = 0; i < w; i++)if (!isW[i])cntW++; for (int i = 0; i < h; i++)if (!isH[i])cntH++; ll cnt = cntW * cntH; std::cout << all - cnt - n << std::endl; return 0; }