#include <bits/stdc++.h>
using namespace std;
int n, a[10000], m, x, v[10000], sol[10000];
void g(int n) {
  for (int i = 2; i <= 1000; i++) {
    for (int q = i; q <= 1000; q++) {
      if (q % i != 0 && i * q <= 1000) v[i * q] = 1;
    }
  }
}
int main() {
  int k = 0;
  cin >> n;
  g(n);
  for (int i = 2; i <= n; i++) {
    if (v[i] == 0) {
      sol[k] = i;
      k++;
    }
  }
  cout << k << endl;
  for (int i = 0; i < k; i++) {
    cout << sol[i] << " ";
  }
  return 0;
}
