#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> megoldasok;
bool isprime(int mi) {
  for (int i = 2; i <= sqrt(mi); i++) {
    if (mi % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  cin >> n;
  if (n == 1) {
    cout << "0";
    return 0;
  }
  for (int i = 2; i <= n; i = i + 1) {
    if (isprime(i)) {
      megoldasok.push_back(i);
      for (int j = 2; j > 0; j++) {
        if (pow(i, j) <= n) {
          megoldasok.push_back(pow(i, j));
        } else {
          break;
        }
      }
    }
  }
  cout << megoldasok.size() << endl;
  for (int i = 0; i < megoldasok.size(); i++) {
    cout << megoldasok[i] << " ";
  }
  return 0;
}
