#include <bits/stdc++.h>
using namespace std;
using std::ios;
constexpr int MOD = 1e9 + 7;
constexpr int mod = 998244353;
template <typename T>
T power(T a, T b) {
  T r = 1;
  while (b) {
    if (b & 1) r *= a;
    b /= 2;
    a *= a;
  }
  return r;
}
const int mxn = 1e3 + 5;
vector<int> primes;
bool p[mxn];
void sieve() {
  for (int i = 2; i * i <= mxn; i++) {
    if (p[i]) {
      for (int j = 2 * i; j < mxn; j += i) {
        p[j] = 0;
      }
    }
  }
  for (int i = 2; i < mxn; i++) {
    if (p[i]) primes.push_back(i);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  for (int i = 2; i < mxn; i++) p[i] = 1;
  sieve();
  vector<int> ans;
  vector<int> vis(mxn + 1, 0);
  for (int pr : primes) {
    if (!vis[pr]) {
      for (int j = pr; j <= n; j *= pr) {
        vis[j] = 1;
        ans.push_back(j);
      }
    }
  }
  sort((ans).begin(), (ans).end());
  cout << ans.size() << '\n';
  for (int i : ans) cout << i << ' ';
}
