#include <bits/stdc++.h>
using namespace std;
const int maxm = 100001;
long long m = 1e9 + 7;
vector<vector<int> > adj;
vector<int> h;
vector<int> sz;
vector<int> in;
long long add(long long a, long long b, long long m) {
  return ((a % m) + (b % m)) % m;
}
long long mul(long long a, long long b, long long m) {
  return ((a % m) * (b % m)) % m;
}
long long sub(long long a, long long b, long long m) {
  return ((a % m) - (b % m) + m) % m;
}
long long modmul(long long a, long long b, long long mod) {
  long long ans = 0;
  a = a % mod;
  while (b) {
    if (b & 1) ans = add(ans, a, mod);
    a = mul(a, 2, mod);
    b >>= 1;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long fe(long long base, long long exp, long long mod) {
  long long ans = 1;
  while (exp) {
    if (exp & 1) ans = modmul(ans, base, mod);
    base = modmul(base, base, mod);
    exp >>= 1;
  }
  return ans;
}
void dfs_h_sz(int cur, int par) {
  h[cur] = h[par] + 1;
  sz[cur]++;
  for (const auto &v : adj[cur]) {
    if (v == par) continue;
    dfs_h_sz(v, cur);
    sz[cur] += sz[v];
  }
}
void buildGraph(int n, int m) {
  adj = vector<vector<int> >(n + 1);
  h = vector<int>(n + 1);
  sz = vector<int>(n + 1);
  in = vector<int>(n + 1);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  dfs_h_sz(1, 0);
}
struct cmp {
  bool operator()(const pair<int, int> &a, const pair<int, int> &b) {
    return a.first < b.first;
  }
};
bool getprimefact(int n) {
  int ch = 0;
  while (n % 2 == 0) {
    n /= 2;
    ch = 1;
  }
  for (int j = 3; j * j <= n; j += 2) {
    int cur = n;
    while (n % j == 0) {
      if (ch) return false;
      n /= j;
    }
    if (cur % j == 0) ch = 1;
  }
  if (n > 2 && ch) return false;
  return true;
}
void solve() {
  int n;
  cin >> n;
  vector<int> vec;
  for (int i = 2; i <= n; i++) {
    if (getprimefact(i)) vec.push_back(i);
  }
  cout << vec.size() << "\n";
  for (int i = 0; i < vec.size(); i++) {
    cout << vec[i] << " ";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  ;
  int test;
  test = 1;
  while (test--) {
    solve();
  }
  return 0;
}
