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