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