#include <bits/stdc++.h>
int main() {
  std::ios_base::sync_with_stdio(false);
  int n;
  std::cin >> n;
  std::vector<bool> nums(n + 1, true);
  std::vector<int> primes;
  for (int i = 2; i <= sqrt(n); i++) {
    if (nums[i] == true) {
      for (int j = 2 * i; j <= n; j += i) nums[j] = false;
      primes.push_back(i);
    }
  }
  for (int i = sqrt(n) + 1; i <= n; i++) {
    if (nums[i] == true) primes.push_back(i);
  }
  std::vector<int> q;
  for (int i = 0; i < primes.size(); i++) {
    int tmp = primes[i];
    while (tmp <= n) {
      q.push_back(tmp);
      tmp *= primes[i];
    }
  }
  std::cout << q.size() << "\n";
  if (q.size() != 0) {
    for (int i = 0; i < q.size() - 1; i++) std::cout << q[i] << " ";
    std::cout << q[q.size() - 1] << "\n";
  }
}
