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