long s,n;i;main(){for(scanf("%ld",&n),n/=2-n%2;n>++i*i;s+=n%i?0:i+n/i);i=!printf("%ld",n-i*i?s:s+i);}