Var i,n,s:integer;
Begin
While n<=0 do
Write('N = ');readln(n);
For i:=1 to n do
If n mod i = 0 then s:=s+i;
Write('Tong cac uoc cua ',n,' la ',s);
Readln;
End.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,i,t=0;
cin>>n;
for (int i=1; i<=n; i++)
if (n%i==0) t+=i;
cout<<t;
return 0;
}