#include <bits/stdc++.h>
using namespace std;
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long mod = 1000000000 + 7;
long long power(long long n, long long k) {
  long long power = 1;
  for (int i = 0; i < k; i++) {
    power = (power * n) % mod;
  }
  return power % mod;
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool isPrime[1200];
vector<int> v, divis;
int main() {
  fast();
  int n;
  cin >> n;
  for (int i = 2; i <= 1000; i++) isPrime[i] = 1;
  for (int i = 2; i * i <= 1000; i++) {
    if (isPrime[i]) {
      for (int j = i * 2; j <= 1000; j += i) {
        isPrime[i] = 0;
      }
    }
  }
  for (int i = 2; i <= n; i++) {
    int num = i;
    for (int j = 2; j <= num; j++) {
      long long pro = 1;
      while (num % j == 0) {
        pro *= j;
        num /= j;
      }
      if (pro > 1) v.push_back(pro);
    }
    if (num > 1) v.push_back(num);
    sort(v.begin(), v.end());
    v.resize(unique(v.begin(), v.end()) - v.begin());
  }
  cout << v.size() << "\n";
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  return 0;
}
