h,w,q = map(int, input().split()) d={} a=w*h for _ in range(q): y, x = map(int, input().split()) if x not in d: d[x]=y a=a-(h-d[x])-1 elif y