#include using namespace std; long long ans = 0, n; int main() { cin >> n; int k = sqrt(n); for(int i = 1; i <= k; ++i) if(n % i == 0) ans += i + n / i; if(k * k == n) cout << ans - k; else cout << ans; cout << '\n'; }