#include #define FOR(i,a,b) for(int i = (a); i < (b); ++i) #define REP(i,n) FOR(i,0,n) #define SZ(n) (int)(n).size() #define ALL(n) (n).begin(), (n).end() #define MOD 1000000007 #define INF 100000000 using namespace std; typedef long long LL; typedef vector VI; typedef pair PI; int main() { int w, h; LL n; cin >> w >> h >> n; LL ans = w * h - n; set ss, ks; REP(i, n) { int s, k; cin >> s >> k; ss.insert(s); ks.insert(k); } ans = ans - (w - ss.size()) * (h - ks.size()); cout << ans << endl; return 0; }