#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int primes[N], n;
vector<int> ad;
int main() {
  fill(primes, primes + N, 1);
  primes[0] = primes[1] = 0;
  for (int i = 2; i * i < N; i++)
    if (primes[i]) {
      for (int j = i * i; j < N; j += i) primes[j] = 0;
    }
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    if (primes[i]) {
      for (int p = 1; p * i <= n; p *= i) ad.push_back(p * i);
    }
  }
  cout << ad.size() << endl;
  for_each(begin(ad), end(ad), [](int x) { cout << x << ' '; });
  return 0;
}
