import strutils let N=stdin.readLine.parseInt var ans=0 var i=1 while i*i<=N: if N mod i==0: ans+=(i+(N div i)) if i==(N div i): ans-=i i+=1 echo ans