w,h,n,*t=`dd`.split.map &:to_i f=->i{t.select{i=!i}.uniq.size} p f[1]*w-n+f[p]*h-=f[1]