($x,$y,$h)=glob<>; ($x,$y)=sort{$a-$b}$x,$y; $h/=1e3; for$i(0..19){ for$j(0..19){ if( ($i==0||$x/2**($i-1)>$h*2**($i-1))&& ($j==0||$y/2**($j-1)>$h*2**($i+$j-1)) ){ $%+=$-=$i+$j-$% } } } print$%