#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
vector<long long int> prime;
void sieve() {
  bitset<2000> b;
  b.set();
  b[0] = 0, b[1] = 0;
  for (long long int i = 2; i * i < 2000; i++) {
    if (b[i])
      for (long long int j = i * i; j < 2000; j += i) b[j] = 0;
  }
  for (long long int i = 2; i < 2000; i++) {
    if (b[i]) prime.push_back(i);
  }
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  sieve();
  vector<long long int> ans;
  for (long long int i = 0; i < prime.size(); i++) {
    long long int temp = prime[i];
    while (temp <= n) {
      ans.push_back(temp);
      temp *= prime[i];
    }
  }
  cout << ans.size() << '\n';
  for (auto u : ans) cout << u << " ";
  cout << '\n';
  return 0;
}
