#include #include #include #include #include #include #include #define MAX 10000 using namespace std; int main(int argc, const char * argv[]) { int W; cin >> W; int H; cin >> H; int N; cin >> N; list uniqueW; list uniqueH; int tmp; for (int i = 0; i < N; i++) { cin >> tmp; uniqueW.push_back(tmp); cin >> tmp; uniqueH.push_back(tmp); } uniqueW.unique(); uniqueH.unique(); //オーバーフロー long long result; // result = uniqueW.size()*H + uniqueH.size()*(W-uniqueW.size())-N; cout << result; cout << "\n"; }