/****************** * Subham kumar * * * *******************/ #include using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef vector vi; #define F first #define S second typedef pair ii; #define boost ios_base::sync_with_stdio(false);cin.tie(0); cout.tie(0) #define pb push_back #define fl(i,a,b) for(int i=int(a);i<=int(b);i++) #define mp make_pair #define all(c) c.begin(),c.end() #define present(c,x) ((c).find(x) != (c).end()) #define cpresent(c,x) (find(all(c),x) != (c).end()) #define tr(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++) typedef vector vii; typedef vector vvii; #define PI 3.14159265359 #define N 4000000 #define mod 1000000007 bool pp(ll x){ if(x<=1){ return false; } if(x<=3){ return true; } if(x%2==0 or x%3==0){ return false; } for(int i=5 ; i*i<=x ; i=i+6){ if(x%i==0 || x%(i+2)==0) return false; } return true; } int main(){ boost; int n; cin>>n; ll ans=0; for(int i=0;i>x; int j=3; if(x==1){ ans++; }else if(pp(x)){ ans=ans+x+1; }else{ while(x>0){ if(pp(x)){ ans=ans+x+1; break; }else if(x%2==0){ ans=ans+x; x=x/2;} else{ while(n%j!=0) j=j+2; ans=ans+x; x=x/j; } } } } cout<