#include <bits/stdc++.h>
using namespace std;
class Solution {
 private:
  bool isPrime(int n) {
    if (n % 2 == 0 || n % 3 == 0) return (n < 4);
    for (int i = 5, d = 2; i * i <= n; i += d, d = 6 - d)
      if (n % i == 0) return false;
    return true;
  }

 public:
  void solve(std::istream& in, std::ostream& out) {
    int n;
    in >> n;
    vector<int> ans;
    for (int i = 2; i <= n; ++i)
      if (isPrime(i)) {
        int j = i;
        while (j <= n) {
          ans.push_back(j);
          j *= i;
        }
      }
    out << ans.size() << endl;
    for (auto i : ans) out << i << " ";
  }
};
void solve(std::istream& in, std::ostream& out) {
  out << std::setprecision(12);
  Solution solution;
  solution.solve(in, out);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  istream& in = cin;
  ostream& out = cout;
  solve(in, out);
  return 0;
}
