#include #define rep(i,n) for(int i=(0);i<(n);i++) using namespace std; typedef long long ll; template bool chmax(T &a, const T &b) { if (a bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; } int main(){ cin.tie(0); ios::sync_with_stdio(false); ll w, h, n; cin >> w >> h >> n; set sst, kst; rep(i, n){ ll s, k; cin >> s >> k; sst.insert(s); kst.insert(k); } ll ss = sst.size(); ll ks = kst.size(); ll ans = ss * h + ks * w - ss * ks - n; cout << ans << endl; }