f=lambda:map(int,input().split()) H,W,Q=f() d={} t=H*W for i in range(Q): y,x=f() z=d.get(x,0) e=max(z,H-y+1) d[x]=e t-=e-z print(t)