#include <bits/stdc++.h>
using namespace std;
vector<vector<bool> > g;
vector<vector<int> > cnt;
vector<pair<int, int> > ans;
void yes1() {
  cout << "YES";
  exit(0);
}
void no1() {
  cout << "NO";
  exit(0);
}
int main() {
  int n;
  cin >> n;
  vector<int> v(n + 1, 0), res;
  for (int i = 2; i <= n; i++)
    if (!v[i]) {
      for (int j = 2; i * j <= n; j++) v[i * j] = 1;
      for (int j = i; j <= n; j *= i) res.push_back(j);
    }
  cout << res.size() << endl;
  for (int i = 0; i < (int)res.size(); i++) cout << res[i] << " ";
}
