#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v;
  int n, i, j, k, len, x, y, c, a[1020] = {0};
  cin >> n;
  if (n == 1) {
    cout << "0" << endl;
    return 0;
  }
  a[1] = 1;
  for (i = 2; i <= 1000; i++) {
    c = 2;
    for (j = i * c; j <= 1000; j = i * c) {
      a[j] = 1;
      c++;
    }
  }
  for (i = 2; i <= n; i++) {
    if (a[i] == 0) {
      for (j = i; j <= n; j = j * i) {
        v.push_back(j);
      }
    }
  }
  cout << v.size() << endl;
  for (i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
}
