#include<iostream> using namespace std; int main(){ int a,b=1,c=0; cin>>a; for(;b<=a;b++){ if(a%b==0) c=c+b; } cout<<c; return 0; }