#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k;
  int arr[1005];
  vector<int> v;
  v.push_back(2);
  int cnt;
  for (i = 3; i < 1003; i++) {
    cnt = 0;
    memset(arr, 0, sizeof(arr));
    for (j = 0; j < v.size(); j++) {
      if (arr[v[j]] == 0) {
        for (k = 2 * v[j]; k < i + 3; k += v[j]) {
          arr[k]++;
        }
      }
    }
    if (arr[i] < 2) {
      v.push_back(i);
    }
  }
  cin >> n;
  if (n == 1) {
    cout << "0";
    return 0;
  }
  vector<int> ans;
  for (i = 0; i < v.size(); i++) {
    if (v[i] > n) break;
    ans.push_back(v[i]);
  }
  cout << ans.size() << endl;
  for (i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
