#include <bits/stdc++.h>
using namespace std;
vector<int> v, prime;
bool ciur[1005];
void cErath(int n) {
  for (int i = 2; i <= n; i++) ciur[i] = true;
  int r = sqrt(n) + 1;
  for (int p = 2; p <= r; p++) {
    if (ciur[p] == 1)
      for (int j = p * p; j <= n; j += p) ciur[j] = false;
  }
  for (int i = 2; i <= n; ++i)
    if (ciur[i] == true) prime.push_back(i);
}
int main() {
  int n;
  cin >> n;
  cErath(n);
  int m = n;
  for (int i = 0; i < prime.size(); ++i) {
    int e = 0;
    int p = 1;
    while (p * prime[i] <= n) {
      p *= prime[i];
      v.push_back(p);
    }
  }
  cout << v.size() << "\n";
  for (int i = 0; i < v.size(); ++i) {
    cout << v[i] << " ";
  }
}
