w=int(input()) h=int(input()) sw=set() sh=set() n=w*h for i in range(int(input())): s,k=map(int,input().split()) sw|={s};sh|={k};n-=1 print(n-(w-len(sw))*(h-len(sh)))