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