#include <bits/stdc++.h>
using namespace std;
bitset<1001> bs;
vector<int> primes;
int n, m;
int main() {
  bs.set();
  bs[0] = bs[1] = 0;
  for (long long i = 2; i < 1001; i++) {
    if (bs[i]) {
      for (long long j = i * i; j < 1001; j += i) bs[j] = 0;
      primes.push_back(i);
    }
  }
  int numberOfQuestions = 0, temp;
  cin >> n;
  vector<int> ans;
  for (int i = 0; i < primes.size(); i++) {
    if (primes[i] <= n) {
      numberOfQuestions++;
      ans.push_back(primes[i]);
      temp = primes[i];
      while (temp * primes[i] <= n) {
        temp *= primes[i];
        ans.push_back(temp);
        numberOfQuestions++;
      }
    } else
      break;
  }
  printf("%d\n", numberOfQuestions);
  for (int i = 0; i < ans.size(); i++) printf("%d ", ans[i]);
}
