#include using namespace std; int main() { long n, s = 0; cin >> n; for (long i = 1; i <= n / 2; i++) { if (n % i == 0) s += i; } cout << s + n << endl; }