$N=<>; $N%$_||push@_,$_ for 1..sqrt$N; push@_,$N/$_ for@_; $%=1e11; map{//;$_%$' or$%-=$-=$%-($'+$_/$'+$N/$_-3)for@_}@_; print$%,$",$N-1