#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.precision(30);
  long long n;
  cin >> n;
  vector<long long> primes(n + 1, 1), ans;
  primes[0] = primes[1] = 0;
  for (long long i = 2; i <= sqrt(n); i++)
    if (primes[i])
      for (long long j = i * i; j <= n; j += i) primes[j] = 0;
  for (long long i = 2; i <= n; i++) {
    if (primes[i]) {
      long long a = 1;
      while (a <= n / i) {
        a *= i;
        ans.push_back(a);
      }
    }
  }
  cout << ans.size() << '\n';
  for (auto i : ans) cout << i << ' ';
  cout << '\n';
  return 0;
}
