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