#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> prime;
  vector<char> pr(n + 1, true);
  pr[0] = pr[1] = false;
  for (int i = 2; i * i <= n; i++) {
    if (pr[i] == true) {
      for (int j = i * i; j <= n; j = j + i) {
        pr[j] = false;
      }
    }
  }
  for (int i = 2; i <= n; i++) {
    if (pr[i] == true) prime.push_back(i);
  }
  int count = 0;
  vector<int> ans;
  for (int x : prime) {
    int t = x;
    while (t <= n) {
      ans.push_back(t);
      t = t * x;
    }
  }
  cout << ans.size() << "\n";
  for (int x : ans) {
    cout << x << " ";
  }
}
