#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int prime[1005] = {0}, res[10005];
  int i, j, k = 0;
  for (i = 2; i <= n; i++) {
    if (prime[i] == 0) {
      res[k] = i;
      k++;
      for (j = 2 * i; j <= n; j += i) {
        prime[j] = 1;
      }
    }
  }
  int l = k;
  for (i = 0; i < l; i++) {
    int x = res[i];
    for (j = x * x; j <= n; j = j * x) {
      res[k++] = j;
    }
  }
  cout << k << endl;
  for (i = 0; i < k; i++) {
    cout << res[i] << " ";
  }
  return 0;
}
