#include <bits/stdc++.h>
using namespace std;
bool prime[1005];
int prime1[1005];
int x = 0;
void sieve() {
  fill(prime, prime + 1005, true);
  prime[1] = false;
  for (int i = 2; i <= 1005; i++) {
    if (prime[i] == true) {
      for (int j = i * i; j <= 1005; j += i) {
        prime[j] = false;
      }
    }
  }
  for (int i = 2; i <= 1005; i++) {
    if (prime[i] == true) prime1[x++] = i;
  }
}
int main() {
  sieve();
  int n;
  cin >> n;
  int *ptr = lower_bound(prime1, prime1 + x, n);
  set<int> s;
  for (int i = 0; i < (ptr - prime1); i++) {
    int t = prime1[i];
    s.insert(t);
    while (prime1[i] * t <= n) {
      s.insert(t * prime1[i]);
      t *= prime1[i];
    }
  }
  if (prime[n] == true) s.insert(n);
  cout << s.size() << endl;
  for (set<int>::iterator it = s.begin(); it != s.end(); it++) {
    cout << (*it) << " ";
  }
}
