#include <bits/stdc++.h>
using namespace std;
int primes[1009];
vector<int> fillprimes() {
  vector<int> prime;
  for (int i = 2; i <= sqrt(1009); i++) {
    if (primes[i] == 0) {
      for (int j = i * i; j < 1009; j += i) {
        primes[j] = 1;
      }
    }
  }
  for (int i = 2; i < 1009; i++) {
    if (primes[i] == 0) prime.push_back(i);
  }
  return prime;
}
int main() {
  int n;
  cin >> n;
  unordered_set<int> ans;
  vector<int> prime = fillprimes();
  for (int i = 0; i < prime.size(); i++) {
    if (prime[i] > n) break;
    int num = prime[i];
    while (num <= n) {
      ans.insert(num);
      num *= prime[i];
    }
  }
  cout << ans.size() << '\n';
  for (auto i : ans) cout << i << " ";
}
