#include <bits/stdc++.h>
using namespace std;
void init();
void solve();
long n, isPrime[10000];
vector<int> vt;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  init();
  solve();
  return 0;
}
void init() { cin >> n; }
void solve() {
  if (n == 1) {
    cout << 0;
    return;
  }
  for (typeof(n) i = 2; i <= n; i++) {
    if (isPrime[i] == 0) {
      vt.push_back(i);
      for (int j = i * i; j <= n; j += i) {
        isPrime[j] = 1;
      }
      for (int j = i * i; j <= n; j *= i) vt.push_back(j);
    }
  }
  cout << vt.size() << "\n";
  for (typeof(vt.size()) i = 0; i < vt.size(); i++) cout << vt[i] << " ";
}
