#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> ans;
  for (int i = 2; i <= n; i++) {
    int k = i;
    for (int j = 2; j <= k; j++) {
      if (k % j == 0) {
        while (k % j == 0) k /= j;
        break;
      }
    }
    if (k == 1) ans.push_back(i);
  }
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
