#include <bits/stdc++.h>
using namespace std;
int N = 1001;
vector<int> pr;
vector<int> lp(N, 0);
void Er() {
  for (int i = 2; i < N; ++i) {
    if (lp[i] == 0) {
      lp[i] = i;
      pr.push_back(i);
    }
    for (int j = 0; j < pr.size() && i * pr[j] < N && pr[j] <= lp[i]; ++j) {
      lp[i * pr[j]] = pr[j];
    }
  }
}
int main() {
  int n;
  cin >> n;
  Er();
  vector<bool> na(n + 1, false);
  vector<int> ans;
  for (int i = 0; i < pr.size(); ++i) {
    int j = pr[i];
    while (j <= n) {
      na[j] = true;
      j *= pr[i];
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (na[i]) {
      ans.push_back(i);
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); ++i) {
    cout << ans[i] << ' ';
  }
  return 0;
}
