#include <bits/stdc++.h>
using namespace std;
int p[1005];
void sieve() {
  for (int i = 0; i <= 1005; i++) p[i] = 0;
  p[0] = 1;
  p[1] = 1;
  for (int i = 2; i <= 1005; i++) {
    if (!p[i]) {
      for (int j = 2 * i; j <= 1005; j += i) p[j] = 1;
    }
  }
}
int main() {
  sieve();
  int n;
  cin >> n;
  vector<int> v;
  for (int i = 2; i <= n; i++) {
    if (!p[i]) {
      int x = i, y = i;
      while (x <= n) {
        v.push_back(x);
        x *= y;
      }
    }
  }
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << endl;
}
