#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; bool mark[1000001],num[1000001]; #define LL long long int main(void){ LL H, W, h = 0, w = 0;int N; cin >> H >> W >> N; for (int i = 0; i < N; i++) { int a, b; cin >> a >> b; if (mark[a] == false)h++; if (mark[b] == false)w++; mark[a] = mark[b] = true; } cout << h*W + w*H - h*w - N << endl;; return 0; }