#include using namespace std; #define int long long int row[1000100]; int col[1000100]; signed main(){ int W,H; cin >> W >> H; int N; cin >> N; int ans = 0; for(int i = 0 ; i < N ; i++){ int x,y; cin >> x >> y; row[y]++; col[x]++; } int r = 0; for(int i = 0 ; i <= 1000000 ; i++){ if( row[i] ) ans += W - row[i], r++; } for(int i = 0 ; i <= 1000000 ; i++){ if( col[i] ) ans += H - col[i] - r; } cout << ans+N << endl; }