#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> s, vis(n + 1);
  for (int i = 2; i <= n; i++) {
    if (vis[i]) continue;
    for (int j = i * i; j <= n; j += i) vis[j] = true;
    s.push_back(i);
    while (s.back() * i <= n) s.push_back(s.back() * i);
  }
  printf("%d\n", (int)(s).size());
  for (auto u : s) printf("%d ", u);
  printf("\n");
  return 0;
}
