h,w,q=gets.split.map(&:to_i) l=Hash.new(h+1) a=h*w q.times do y,x=gets.split.map(&:to_i) if l[x-1]>y a-=l[x-1]-y l[x-1]=y end puts a end