#coding: utf-8 ##yuki_11 w=int(raw_input()) h=int(raw_input()) n=int(raw_input()) ss=set([]) sk=set([]) for i in xrange(n): s,k=map(int,raw_input().split()) ss.add(s) sk.add(k) res=len(ss)*h+len(sk)*w-len(ss)*len(sk)-n print res