from collections import defaultdict h,w,q= list(map(int,input().split())) d = defaultdict(lambda:h) seat = h*w for i in range(q): y,x= list(map(int,input().split())) if d[x] >= y: seat -= d[x]-y+1 d[x] = y-1 print(seat)