#include #include using namespace std; long N; int pf[1<<20]; int ps[7]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); for(int i=2;i<1<<20;i++)if(pf[i]==0) { for(int j=i;j<1<<20;j+=i)pf[j]=i; } cin>>N; long ans=0; for(int m=2;;m++) { long up=(double)N/(2*m); int l=m+1,r=(int)min(up,2*m-1L); if(l>r)break; int pssz=0; { int v=m; while(v%2==0)v/=2; while(v>1) { int p=pf[v]; ps[pssz++]=p; while(v%p==0)v/=p; } } assert(pssz<=6); long sum=0; for(int i=0;i<1<>j&1)t*=ps[j]; int nl=(double)(l+t-1)/t,nr=(double)r/t; if(nl%2==0)nl++; long nup=(double)up/t; long cur=0; while(nl<=nr) { long q=(double)nup/nl; int nnl=nr; if(nup