#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const int p_N = 1005;
int flag[p_N + 5], prime[p_N + 5];
int pk = 0;
void get_p() {
  for (int i = 2; i < p_N; i++) {
    if (!flag[i]) prime[pk++] = i;
    for (int j = 0; i * prime[j] < p_N; j++) {
      flag[i * prime[j]] = 1;
      if (i % prime[j] == 0) break;
    }
  }
}
int ans[1005];
int k = 0;
int main() {
  get_p();
  int n, t;
  cin >> n;
  for (int i = 0; prime[i] <= n && i < pk; i++) {
    for (t = prime[i]; t <= n; t *= prime[i]) {
      ans[k++] = t;
    }
  }
  printf("%d\n", k);
  if (k == 0) return 0;
  for (int i = 0; i < k; i++) printf("%d ", ans[i]);
  putchar('\n');
  return 0;
}
