$n=<>; while($n&$n-1){ $n=$n&$n-1; } print$n;