#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  if (n == 1) {
    cout << 0 << '\n';
    return 0;
  }
  vector<int> primes;
  vector<int> mark(1001);
  for (int i = 2; i <= 1000; i++) {
    if (mark[i] == 1) continue;
    for (int j = i * i; j <= 1000; j += i) mark[j] = 1;
  }
  for (int i = 2; i < mark.size(); i++) {
    if (mark[i] == 0) primes.push_back(i);
  }
  vector<int> ctr(primes.size());
  vector<int> ret;
  for (int i = 2; i <= n; i++) {
    int x = i;
    for (int j = 0; j < primes.size(); j++) {
      int temp = 0;
      if (primes[j] >= i) break;
      while (temp < ctr[j] && x % primes[j] == 0) {
        x /= primes[j];
        temp++;
      }
    }
    if (x > 1) {
      ret.push_back(i);
      for (int j = 0; j < primes.size(); j++) {
        if (primes[j] == x) {
          ctr[j]++;
          break;
        }
      }
    }
  }
  cout << ret.size() << '\n';
  for (int i = 0; i < ret.size(); i++) {
    cout << ret[i] << ' ';
  }
}
