#include using namespace std; #define int long long signed main(){ int W, H, N; cin >> W >> H >> N; set< int > suit, val; for( int i = 0; i < N; ++i ){ int S, K; cin >> S >> K; suit.insert( S ); val.insert( K ); } int ans = suit.size() * W + val.size() * H - suit.size() * val.size() - N; cout << ans << endl; return 0; }