#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> divisors;
vector<int> answer;
void recur(int n, int it, int s) {
answer.push_back(s + n - 1);
for (;; ++it) {
int d = divisors[it];
if (d * d > n) break;
if (n % d) continue;
recur(n / d, it, s + d - 1);
}
}
signed main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
// freopen("input.txt", "r", stdin);
int n;
cin >> n;
if (n == 1) {
cout << "1\n0";
return 0;
}
for (int d = 1; d * d <= n; d++) {
if (n % d == 0) {
divisors.push_back(d);
if (d * d < n) {
divisors.push_back(n / d);
}
}
}
sort(divisors.begin(), divisors.end());
recur(n, 1, 0);
sort(answer.begin(), answer.end());
auto end = unique(answer.begin(), answer.end());
cout << end - answer.begin() << '\n';
for (auto it = answer.begin(); it != end; ++it) {
cout << *it << ' ';
}
return 0;
}