#include #include #include #include #include #include #include #include #include #include #include #include #define vll vector #define vvvl vector #define vvl vector> #define VV(a, b, c, d) vector>(a, vector(b, c)) #define VVV(a, b, c, d) vector(a, vvl(b, vll (c, d))); #define re(c, b) for(ll c=0;c> w >> h; ll n;std::cin >> n; set num, mk; re(i, n){ ll a, b;std::cin >> a >> b; num.insert(b); mk.insert(a); } ll ans = mk.size() * h + (w-mk.size()) * num.size(); std::cout << ans - n << '\n'; }