#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
bool a[100100];
void go() {
  long long int n;
  cin >> n;
  memset(a, true, sizeof(a));
  for (int i = 2; i <= n; i++) {
    for (int j = i + 1; i * j <= n; j++) {
      if (j % i == 0) continue;
      a[j * i] = false;
    }
  }
  vector<int> ans;
  for (int i = 2; i <= n; i++) {
    if (a[i]) ans.push_back(i);
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long int t = 1;
  while (t--) go();
}
