#include <bits/stdc++.h>
using namespace std;
const int size = 1005;
const long long int mod = 1e9 + 7;
const long long int inf = 1e18;
long long int gcd(long long int a, long long int b) {
  if (!a) return b;
  return gcd(b % a, a);
}
bool is_prime[size];
vector<int> primes;
void sieve() {
  fill(is_prime, is_prime + size, 1);
  is_prime[0] = is_prime[1] = 0;
  for (int i = 2; i < size; i++) {
    if (is_prime[i]) primes.push_back(i);
    for (int j = 0; j < primes.size() && primes[j] * i < size; j++) {
      is_prime[primes[j] * i] = 0;
      if (i % primes[j] == 0) break;
    }
  }
}
int main() {
  sieve();
  set<int> s;
  int n;
  cin >> n;
  for (int i = 0; i < primes.size() && primes[i] <= n; i++) {
    s.insert(primes[i]);
    int x = primes[i] * primes[i];
    while (x <= n) {
      s.insert(x);
      x = x * primes[i];
    }
  }
  cout << (int)s.size() << "\n";
  for (auto i : s) cout << (i) << " ";
  cout << "\n";
  return 0;
}
