#include <bits/stdc++.h>
using namespace std;
int arr[100010];
int sieve[100010];
int isprime[100010];
int main() {
  int n, i, j, cnt = 0;
  scanf("%d", &n);
  for (int i = (0); i < (n + 1); ++i) isprime[i] = 1;
  isprime[0] = isprime[1] = 0;
  for (i = 2; i * i <= n; i++)
    if (isprime[i]) {
      for (j = i * i; j <= n; j += i) isprime[j] = 0;
    }
  vector<int> ans;
  for (i = 1; i <= n; i++)
    if (isprime[i]) {
      for (j = i; j <= n; j = j * i) ans.push_back(j);
    }
  printf("%d\n", (int)ans.size());
  for (auto it = ans.begin(); it != ans.end(); it++) printf("%d ", *it);
  printf("\n");
}
