#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<bool> z(n + 1);
  for (int i = 4; i < n; i += 2) z[i] = true;
  vector<int> temp(0);
  for (int j = 2; j < z.size(); j *= 2) temp.push_back(j);
  for (int i = 3; i < z.size(); i += 2) {
    if (!z[i]) {
      for (int j = i; j < z.size(); j *= i) temp.push_back(j);
      for (int j = i * i; j < z.size(); j += 2 * i) z[j] = true;
    }
  }
  cout << temp.size() << endl;
  for (int i = 0; i < temp.size(); i++) cout << temp[i] << " ";
  cout << endl;
  return 0;
}
