import java.io.*; import java.util.*; import java.util.stream.*; public class Main { static final int MAX = 100000; public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); if (n == 0) { n = 998244353; } boolean[] isNotPrimes = new boolean[100000]; ArrayDeque primes = new ArrayDeque<>(); for (int i = 2; i < isNotPrimes.length; i++) { if (!isNotPrimes[i]) { primes.add(i); for (int j = 2; j * i < isNotPrimes.length; j++) { isNotPrimes[j * i] = true; } } } ArrayList idxes = new ArrayList<>(); HashSet ans = new HashSet<>(); for (int i = 0; i < 30; i++) { if ((n & (1 << i)) > 0) { idxes.add(i); ans.add(primes.pollLast()); } } ArrayList values = new ArrayList<>(); for (int i = idxes.size() - 1; i >= 0; i--) { values.add(primes.pollFirst()); } ArrayList currents = new ArrayList<>(); currents.addAll(primes); for (int i = 0; i < idxes.size(); i++) { int x = idxes.get(i); int y = values.get(i); if (x > 0) { ans.add(y); } int base = x * x; int idx = 0; for (int j = 1; j < x; j++) { if (base > MAX) { while (ans.contains(y * currents.get(idx))) { idx++; } ans.add(y * currents.get(idx)); } else { ans.add(base); base *= x; } } } System.out.println(ans.size()); StringBuilder sb = new StringBuilder(); boolean isFirst = true; for (int x : ans) { if (!isFirst) { sb.append(" "); } isFirst = false; sb.append(x); } System.out.println(sb); } } class Utilities { static String arrayToLineString(Object[] arr) { return Arrays.stream(arr).map(x -> x.toString()).collect(Collectors.joining("\n")); } static String arrayToLineString(int[] arr) { return String.join("\n", Arrays.stream(arr).mapToObj(String::valueOf).toArray(String[]::new)); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public int[] nextIntArray() throws Exception { return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray(); } public String next() throws Exception { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }