#include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef vector vint; typedef vector vll; typedef pair pint; typedef pair pll; #define range(i,a,b) for(int i=a;i> w >> h >> n; vector v(n); rep(i,n) cin >> v[i].first >> v[i].second; map mark; map num; rep(i,n) mark[v[i].first]+=1; rep(i,n) num[v[i].second]+=1; cout << w*h-n-(w-mark.size())*(h-num.size()) << endl; }