#include using namespace std; int main(){ int W,H,N; cin >> W >> H >> N; map S,K; long long ans=0; for(int i=0;i> x >> y; S[x]++; K[y]++; } for(auto it=S.begin();it!=S.end();it++){ ans+=H-it->second; } //cout << ans << endl; ans+=K.size()*(W-S.size()); cout << ans << endl; }