#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e3 + 1;
int faza[MAX], ans, n;
void sieve() {
  for (int i = 2; i <= n; i++) {
    if (!faza[i]) {
      faza[i] = i;
      for (int j = 2; i * j <= n; j++) faza[i * j] = 1;
      int p = i;
      while (p <= n) {
        faza[p] = -1;
        p *= i, ans++;
      }
    }
  }
}
int main() {
  scanf("%d", &n);
  sieve();
  printf("%d\n", ans);
  for (int i = 2; i <= n; i++)
    if (faza[i] == -1) printf("%d ", i);
}
