#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  solve();
  return 0;
}
void solve() {
  int i, n, j, d;
  cin >> n;
  vector<int> p(n + 1, 1), a;
  p[0] = 0;
  p[1] = 0;
  for (i = 2; i * i <= n; i++) {
    if (p[i]) {
      for (j = i * i; j <= n; j += i) {
        p[j] = 0;
      }
    }
  }
  for (i = 0; i <= n; i++) {
    if (p[i]) {
      d = 1;
      while (d <= n / i) {
        d *= i;
        a.push_back(d);
      }
    }
  }
  cout << a.size() << "\n";
  for (auto it : a) cout << it << " ";
}
