#include <bits/stdc++.h>
using namespace std;
const int nmax = 1000005;
const int mod = 1e9 + 7;
const long long inf = 3 * 1e12;
const double EPS = 1e-6;
int pr[1010];
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= n; ++i) {
    if (i * i <= n) {
      for (int j = i * i; j <= n; j += i) {
        pr[j] = 1;
      }
    }
  }
  int res = 0;
  for (int i = 2; i <= n; ++i)
    if (!pr[i]) res++;
  for (int i = 2; i <= n; ++i) {
    long long k = i;
    int cnt = 1;
    if (!pr[i])
      while (k * i <= n) k *= i, cnt++;
    res += cnt - 1;
  }
  cout << res << '\n';
  for (int i = 2; i <= n; ++i) {
    long long k = i;
    if (!pr[i]) cout << i << ' ';
    if (!pr[i])
      while (k * i <= n) {
        k *= i;
        cout << k << ' ';
      }
  }
  return 0;
}
