#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
vector<int> primes;
bool sieve[1010];
void mountPrimes() {
  for (int i = 2; i * i < 1010; i++) {
    if (!sieve[i]) {
      int x = i * i;
      while (x < 1010) {
        sieve[x] = true;
        x += i;
      }
    }
  }
  for (int i = 2; i < 1010; i++) {
    if (!sieve[i]) primes.push_back(i);
  }
}
int main() {
  mountPrimes();
  int n;
  cin >> n;
  for (int i = 0; primes[i] <= n; i++) {
    int x = primes[i];
    while (x <= n) {
      ans.push_back(x);
      x *= primes[i];
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < (int)ans.size(); i++) {
    if (i) cout << " ";
    cout << ans[i];
  }
  cout << endl;
  return 0;
}
