# coding: utf-8 # Your code here! N=int(input()) ans=0 for i in range(1,int(N**0.5)+1): if N/i==N//i: ans+=i ans+=N//i print(ans)