#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const int maxn = 1e5 + 10;
const int p = 1024;
int flag[1010];
vector<int> pp;
vector<int> a;
void fi() {
  pp.clear();
  memset(flag, 0, sizeof(flag));
  for (int i = 2; i <= 1000; ++i) {
    if (flag[i] == 0) {
      pp.push_back(i);
      int k = 2;
      while (i * k <= 1000) {
        flag[i * k] = 1;
        k++;
      }
    }
  }
}
int main() {
  fi();
  int n;
  while (cin >> n) {
    a.clear();
    int sum = 0;
    for (int i = 0; i < pp.size(); i++) {
      int k = pp[i];
      while (k <= n) {
        a.push_back(k);
        sum++;
        k *= pp[i];
      }
    }
    cout << sum << endl;
    for (int i = 0; i < a.size(); i++) cout << a[i] << " ";
    cout << endl;
  }
  return 0;
}
