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