#include using namespace std; using Int8 = int8_t; using Int16 = int16_t; using Int32 = int32_t; using Int64 = int64_t; using Int128 = __int128_t; using Word8 = uint8_t; using Word16 = uint16_t; using Word32 = uint32_t; using Word64 = uint64_t; using Word128 = __uint128_t; using Int = int_fast64_t; using Word = uint_fast64_t; using VI = vector; using VW = vector; using VVI = vector; using VVW = vector; using F32 = float; using F64 = double; using F80 = long double; using PII = pair; using PWW = pair; using VPII = vector; using VPWW = vector; using VS = vector; using VVS = vector; using VB = vector; using VVB = vector; #define rep(i,n) for(Int i=0,i##_len=(n); i> W >> H >> N; set sw, sh; rep(i,N) { Int S, K; cin >> S >> K; sw.insert(S); sh.insert(K); } Int w = SZ(sw), h = SZ(sh); cout << (w * H + h * W - w * h - N) << endl; return 0; }