#include <bits/stdc++.h>
using namespace std;
bool p[1110111];
int ans[1110111], sz;
int main() {
  int n;
  p[0] = p[1] = 1;
  cin >> n;
  for (int i = 2; i * i <= n; i++) {
    if (!p[i]) {
      for (int j = i * i; j <= n; j += i) {
        p[j] = 1;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!p[i]) {
      int x = 1;
      while (x <= n / i) {
        x *= i;
        ans[++sz] = x;
      }
    }
  }
  cout << sz << endl;
  for (int i = 1; i <= sz; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
