#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); long long w, h, n; cin >> w >> h >> n; set suit, num; for(int i = 0; i < n; i++) { int t, s; cin >> t >> s; suit.insert(t); num.insert(s); } cout << suit.size() * h + num.size() * w - suit.size() * num.size() - n << endl; return 0; }