h,w,q,*xy = map(int,open(0).read().split()) s = [h]*w ans = h*w for i in range(q): y,x = xy[i*2]-1,xy[i*2+1]-1 if s[x] > y: ans -= s[x]-y s[x] = y print(ans)