#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; #define REP(i,n) for(ll i=0; i<(n); ++i) #define TEN(x) ((ll)1e##x) #define ALL(v) (v).begin(), (v).end() int main(){ ll w,h,n; cin >> w >> h >> n; vector> wh(w); set k_set; REP(i, n) { ll s, k; cin >> s >> k; s--; k--; wh[s].push_back(k); k_set.insert(k); } ll c = 0; REP(i, w) c += (wh[i].empty()) ? k_set.size() : h - wh[i].size(); cout << c << endl; return 0; }