#include <bits/stdc++.h>
#pragma comment(linker, "/stack:67108864")
using namespace std;
const long double EPS = 1e-9;
const long double PI = 3.1415926535897932384626433832795;
const long long INF = 1000 * 1000 * 1000 + 9;
const int NMAX = 1000 * 10 + 3;
int n;
bool s[NMAX];
inline bool read() {
  if (!(cin >> n)) return false;
  return true;
}
inline void solve() {
  memset(s, 0, sizeof s);
  for (int i = 2; i * i <= NMAX; i++) {
    int t = i;
    for (int c = 0; c < int(2); ++c)
      if (!s[i]) {
        for (int j = i * i; j <= NMAX; j += i) s[j] = 1;
        t = n / i;
      }
  }
  s[0] = 1;
  s[1] = 1;
  vector<int> ans;
  for (int i = 1; i <= int(n); ++i) {
    if (!s[i]) {
      int cnt = i;
      while (cnt <= n) {
        ans.push_back(cnt);
        cnt *= i;
      }
    }
  }
  sort((ans).begin(), (ans).end());
  printf("%d\n", ans.size());
  for (int i = 0; i < int(ans.size()); ++i) {
    printf("%d ", ans[i]);
  }
  puts("");
}
int main() {
  ifstream ifile("input.txt");
  if (ifile) {
    freopen("input.txt", "rt", stdin);
  }
  if (ifile) {
    freopen("output.txt", "wt", stdout);
  }
  while (read()) solve();
  return 0;
}
