#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  bool tamaBa[n + 2];
  memset(tamaBa, false, sizeof tamaBa);
  long long cnt = 0;
  vector<long long> print;
  for (int i = 2; i <= n; i++) {
    if (!tamaBa[i]) {
      for (int j = i; j <= n; j += i) {
        tamaBa[j] = true;
      }
      long long use = i;
      while (use <= n) {
        cnt++;
        print.push_back(use);
        use *= i;
      }
    }
  }
  cout << cnt << endl;
  for (int i = 0; i < cnt; i++) {
    cout << print[i] << " ";
  }
  cout << endl;
  return 0;
}
