$%%$_ or$\+=$_+$%/$_*($_<$%/$_)for 1..sqrt(($%=<>)>>=1&~$%);print