#include <bits/stdc++.h>
using namespace std;
const int MX = 200005;
int N, M;
vector<int> d;
vector<int> prime(MX);
bool PRIME(int N) {
  if (N == 2) return true;
  if (N % 2 == 0 || N < 2) return false;
  for (int i = 3; i * i <= N; i += 2)
    if (N % i == 0) return false;
  return true;
}
void Nour_algO() {
  for (int i = 0; i < 2000; i++) prime[i] = false;
  for (int i = 2; i < 2000; i++) {
    if (prime[i]) continue;
    for (int j = i + i; j < 2000; j += i) prime[j]++;
  }
}
set<int> pri;
void solve() {
  cin >> N;
  Nour_algO();
  for (int i = 2; i <= N; i++) {
    if (prime[i]) continue;
    int m = 1;
    while (m <= N) {
      if (m <= N) pri.insert(m);
      m *= i;
    }
  }
  pri.erase(1);
  cout << pri.size() << "\n";
  for (set<int>::iterator it = pri.begin(); it != pri.end(); it++)
    cout << *it << " ";
}
int main() {
  solve();
  return 0;
}
