#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>w>>h>>n; vector vx(n),vy(n); for(Int i=0;i>vx[i]>>vy[i]; set sx,sy; for(Int x:vx) sx.emplace(x); for(Int y:vy) sy.emplace(y); Int ans=sx.size()*h+sy.size()*w-sx.size()*sy.size()-n; cout<