#include <bits/stdc++.h>
using namespace std;
void preprocess() {}
int sieve[1005];
vector<int> primes;
void calc_sieve() {
  for (long long int i = 0; i < 1005; i++) sieve[i] = 0;
  sieve[0] = sieve[1] = -1;
  for (int i = 2; i < 1005; i++) {
    if (sieve[i] == 0) {
      primes.push_back(i);
      for (int j = i; j < 1005; j = j + i) {
        sieve[j]++;
      }
    }
  }
}
int ans = 0;
vector<int> a;
void init() { calc_sieve(); }
void solve(int test_case) {
  init();
  int n;
  scanf("%d", &n);
  for (int i = 0; i < primes.size() && primes[i] <= n; i++) {
    int temp = primes[i];
    while (temp <= n) {
      ans++;
      a.push_back(temp);
      temp *= primes[i];
    }
  }
  cout << ans << endl;
  for (int i = 0; i <= (int)a.size() - 1; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
}
int main() {
  preprocess();
  int t = 1;
  for (int i = 1; i <= t; i++) solve(i);
  return 0;
}
