#include <bits/stdc++.h>
using namespace std;
vector<int> q;
int n;
bool isPrime(int num) {
  for (int i = 2; i * i <= num; i++) {
    if (num % i == 0) return 0;
  }
  return 1;
}
void addOSS(int num) {
  int m = num * num;
  while (m <= n) {
    q.push_back(m);
    m *= num;
  }
  return;
}
int main() {
  cin >> n;
  for (int i = 2; i <= n; ++i) {
    if (isPrime(i)) {
      q.push_back(i);
      addOSS(i);
    }
  }
  int sum = q.size();
  cout << sum << endl;
  for (int i = 0; i < sum; ++i) {
    cout << q[i] << " ";
  }
  return 0;
}
