// yukicoder 888 約数の総和 // 2019.9.20 bal4u #include #include typedef long long ll; int main() { ll N, s; int i, b; scanf("%lld", &N); s = 0, b = (int)sqrt((double)N); for (i = 1; i < b; i++) { if (N % i == 0) s += i + N/i; } if (N % b == 0) { if (b*b == N) s += b; else s += b + N/b; } printf("%lld\n", s); return 0; }