#include<iostream> int main(){ int a,b=1,c=0; scanf("%d",&a); while(b<=a){ if(a%b==0) c=c+b; b++; } printf("%d",c); return 0; }