#include <bits/stdc++.h>
using namespace std;
void sieve(int n, bool prime[]) {
  for (int i = 2; i <= n; i++) {
    if (prime[i] == 0) {
      int j = 2, num;
      while ((num = j * i) <= n) {
        prime[num] = 1;
        j++;
      }
    }
  }
  return;
}
int main() {
  int n;
  cin >> n;
  bool prime[n + 1];
  memset(prime, 0, sizeof(prime));
  sieve(n, prime);
  int l = 0;
  queue<int> q;
  for (int i = 2; i <= n; i++) {
    if (prime[i] == 0) {
      int x = i;
      while (x <= n) {
        q.push(x);
        l++;
        x *= i;
      }
    }
  }
  cout << l << endl;
  while (q.empty() == false) {
    cout << q.front() << " ";
    q.pop();
  }
  cout << endl;
  return 0;
}
