#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int N = sqrt(n);
  int prime[n + 10];
  memset(prime, 0, sizeof(prime));
  prime[0] = 1;
  prime[1] = 1;
  for (int i = 2; i <= n; i++) {
    int j = 0;
    while ((i * i) + (i * j) <= n) {
      prime[(i * i) + (i * j)] = 1;
      j++;
    }
  }
  vector<int> ans;
  for (int i = 0; i <= n; i++) {
    if (!prime[i]) {
      int q = 1;
      while (q <= n / i) {
        q *= i;
        ans.push_back(q);
      }
    }
  }
  int len = ans.size();
  cout << len << endl;
  for (int i = 0; i < len; i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
