#include <bits/stdc++.h>
using namespace std;
int n;
bool isprime(int x) {
  if (x == 1) return false;
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0) return false;
  return true;
}
int main() {
  scanf("%d", &n);
  vector<int> answer;
  for (int i = 2; i <= n; i++)
    if (isprime(i)) {
      int cur = i;
      for (; cur <= n; cur *= i) answer.push_back(cur);
    }
  sort(answer.begin(), answer.end());
  printf("%d\n", answer.size());
  for (auto u : answer) printf("%d ", u);
  return 0;
}
