<>;@d=sort{$a-$b}glob<>;map$z+=abs,glob<>;print$z?grep($z==$_,@d)?1:grep({$_&1?$b:$a=$_;$z&1?$z>=abs$b-$a&$z<=$a+$b:$z<=$_*2}@d)?2:-1:0