#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dbg(...) 47
#endif
vector<int> divs;
set<int> s;
void go(int n, int cnt, int sum, int prv) {
if (n == 1) {
s.insert(sum);
return;
}
if (cnt == 0) {
return;
}
for (auto x : divs) {
if (x < prv) continue;
int k = 1;
for (int i = 0; i < cnt; i++) {
k *= x;
if (k > n) break;
}
if (k > n) break;
if (n % x != 0) continue;
go(n / x, cnt - 1, sum + x - 1, x);
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
for (int i = 1; i * i <= n; i++) {
if (n % i == 0) {
divs.push_back(i);
if (i * i != n) {
divs.push_back(n / i);
}
}
}
ranges::sort(divs);
go(n, 30, 0, 1);
cout << s.size() << '\n';
for (auto x : s) {
cout << x << ' ';
}
cout << '\n';
return 0;
}