#include <bits/stdc++.h>
using namespace std;
template <typename T>
vector<T> readVector(int n) {
  vector<T> res(n);
  for (int i = 0; i < n; i++) cin >> res[i];
  return res;
}
template <typename T>
void printVector(vector<T> in) {
  int n = in.size();
  for (int i = 0; i < n; i++) {
    cout << in[i] << " \n"[i == n - 1];
  }
}
const long long int mod = 1e9 + 7;
long long int powmod(long long int base, long long int exp,
                     long long int M = mod) {
  long long int ans = 0;
  while (exp) {
    if (exp & 1) ans = (base * ans) % M;
    base = (base * base) % M;
    exp /= 2;
  }
  return ans;
}
bool isprime[1010];
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    if (!isprime[i]) {
      for (int j = 2 * i; j <= n; j += i) {
        isprime[j] = 1;
      }
    }
  }
  vector<int> ans;
  for (int i = 2; i <= n; i++) {
    if (!isprime[i]) {
      int k = i;
      while (k <= n) {
        ans.push_back(k);
        k *= i;
      }
    }
  }
  cout << ans.size() << endl;
  printVector<int>(ans);
}
