#include <bits/stdc++.h>
using namespace std;
bool composite[1000 + 7];
vector<int> primes;
void Sieve() {
  int lim = sqrt(1000) + 2;
  for (int i = 3; i <= lim; i++) {
    if (!composite[i]) {
      for (int j = i * i, k = i << 1; j <= 1000; j += k) {
        composite[j] = true;
      }
    }
  }
  primes.push_back(2);
  for (int i = 3; i <= 1000; i += 2) {
    if (!composite[i]) {
      primes.push_back(i);
    }
  }
  return;
}
int GCD(int a, int b) {
  if (b == 0)
    return a;
  else
    return GCD(b, a % b);
}
int main() {
  int Case = 1;
  int n, m, k;
  char dump[2];
  Sieve();
  while (scanf("%d", &n) == 1) {
    vector<int> ans;
    for (int i = 0; i < primes.size() && primes[i] <= n; i++) {
      int p = primes[i];
      while (p <= n) {
        ans.push_back(p);
        p = p * primes[i];
      }
    }
    printf("%d\n", ans.size());
    for (int i = 0; i < ans.size(); i++) {
      printf("%d ", ans[i]);
    }
    puts("");
  }
  return 0;
}
