$\+=$N%$_?0:$_+$N/$_*($_**2<$N)for 1..sqrt($N=<>);print