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