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