#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long Q_MOD = 998244353;
void go() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed;
  cout << setprecision(6);
}
const long long maxm = 1e3 + 1;
long long primes[maxm];
long long power(long long x, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res *= x;
    x *= x;
    n /= 2;
  }
  return res;
}
void solve() {
  long long n;
  cin >> n;
  for (long long i = 2; i * i <= maxm - 1; i++) {
    if (primes[i]) continue;
    for (long long j = i * 2; j <= maxm - 1; j += i) primes[j] = 1;
  }
  vector<long long> sol;
  for (long long i = 2; i <= n; i++) {
    if (primes[i]) continue;
    for (long long j = 1;; j++) {
      long long num = power(i, j);
      if (num <= n)
        sol.push_back(num);
      else
        break;
    }
  }
  cout << sol.size() << "\n";
  for (long long x : sol) cout << x << " ";
}
signed main() {
  go();
  long long t = 1;
  while (t--) solve();
}
