#include <bits/stdc++.h>
using namespace std;
int n;
vector<bool> prime(1001, true);
void pre_calc() {
  for (int p = 2; p * p <= 1000; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= 1000; i += p) prime[i] = false;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  pre_calc();
  cin >> n;
  vector<int> a;
  int f = 1;
  for (int i = 2; i <= n; i++) {
    if (prime[i]) {
      f = i * i;
      a.push_back(i);
      while (f <= n) {
        a.push_back(f);
        f *= i;
      }
    }
  }
  cout << a.size() << endl;
  for (auto i : a) {
    cout << i << " ";
  }
  cout << endl;
  return 0;
}
