#include <bits/stdc++.h>
using namespace std;
template <class T>
vector<T> sieveList(T n) {
  vector<T> primes;
  if (n <= 1) return primes;
  vector<bool> prime;
  for (T i = 0; i <= n; i++) {
    prime.push_back(true);
  }
  prime[0] = false;
  prime[1] = false;
  long long m = sqrtl(n);
  for (T i = 2; i <= m; i++) {
    if (prime[i]) {
      for (T k = i * i; k <= n; k += i) {
        prime[k] = false;
      }
    }
  }
  primes.push_back(2);
  for (int i = 3; i <= n; i += 2) {
    if (prime[i]) primes.push_back(i);
  }
  return primes;
}
int calc(int n, int x) {
  int c = 1;
  int z = x;
  while (x * z <= n) {
    c++;
    x *= z;
  }
  return c;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(10);
  int n;
  cin >> n;
  vector<int> v = sieveList(n);
  int c = 0;
  vector<int> res;
  for (int i = 0; i < (int)v.size(); i++) {
    int k = calc(n, v[i]);
    c += k;
    int q = v[i];
    for (int j = 0; j < k; j++) {
      res.push_back(q);
      q *= v[i];
    }
  }
  cout << c << '\n';
  for (int i = 0; i < (int)res.size(); i++) cout << res[i] << " ";
  return 0;
}
