/ /and$s{$`}=$k{$'}=1for($w,$h,@a)=<>;print$w*$h-($w-keys%s)*($h-keys%k)-@a+1