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