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