#include <bits/stdc++.h>
using namespace std;
bool pr(unsigned long long n) {
  if (n == 2) return true;
  if (n % 2 == 0) return false;
  for (unsigned long long i = 3; i * i <= n; i += 2) {
    if (n % i == 0) return false;
  }
  return true;
}
int main() {
  unsigned long long n;
  scanf("%lld", &n);
  vector<unsigned long long> ans;
  for (unsigned long long i = (2); i < (n + 1); i++) {
    if (pr(i)) {
      unsigned long long p = i;
      while (p <= n) {
        ans.push_back(p);
        p *= i;
      }
    }
  }
  cout << ans.size() << endl;
  for (unsigned long long i = (0); i < (ans.size()); i++)
    printf("%lld ", ans[i]);
}
