#include <bits/stdc++.h>
using namespace std;
bool prime(int value) {
  if (value == 1) return false;
  for (int i = 2; i * i <= value; ++i)
    if (value % i == 0) return false;
  return true;
}
vector<int> ans;
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= n; ++i)
    if (prime(i)) {
      int j = i;
      while (j <= n) ans.push_back(j), j *= i;
    }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); ++i) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
