#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> primes;
  for (int i = 2; i < 3001; i++) {
    bool prime = true;
    for (int j = 2; j * j <= i; j++)
      if (i % j == 0) prime = false;
    if (prime) primes.push_back(i);
  }
  vector<int> list;
  for (int i = 0; i < primes.size(); i++) {
    int a = primes[i];
    while (a <= n) {
      list.push_back(a);
      a *= primes[i];
    }
  }
  cout << list.size() << endl;
  for (int i = 0; i < list.size(); i++) cout << (i ? " " : "") << list[i];
  cout << endl;
}
