#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> vec;
int arr[1003], res;
int main() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    if (!arr[i]) {
      for (int j = i; j <= n; j += i) {
        arr[j]++;
      }
    }
  }
  for (int i = 2; i <= n; i++) {
    if (arr[i] == 1) {
      res++;
      vec.push_back(i);
    }
  }
  cout << res << endl;
  for (auto i : vec) {
    cout << i << " ";
  }
  cout << endl;
  return 0;
}
