#include <bits/stdc++.h>
using namespace std;
const int mx = 2e5 + 100;
const int md = 1000000007;
priority_queue<int, vector<int>, greater<int> > pq;
bool compare(pair<int, int> a, pair<int, int> b) {
  if (a.second == b.second) return a.first < b.first;
  return a.second < b.second;
}
vector<int> primes;
bool isPrime[2000] = {};
void sieve() {
  isPrime[0] = isPrime[1] = true;
  for (int i = 2; i < 1100; i += 1) {
    if (isPrime[i] == false) {
      primes.push_back(i);
      for (int j = i * 2; j < 1100; j += i) isPrime[j] = 1;
    }
  }
}
int main() {
  sieve();
  int n;
  scanf("%d", &n);
  vector<int> arr;
  for (int i = 0; i < primes.size(); i += 1) {
    int p = primes[i];
    while (p <= n) {
      arr.push_back(p);
      p *= primes[i];
    }
  }
  printf("%d\n", arr.size());
  for (int i = 0; i < arr.size(); i += 1) printf("%d ", arr[i]);
  printf("\n");
}
