#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-11;
template <class T>
inline void checkmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T &a, T b) {
  if (b > a) a = b;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
int a[10100], ans[10100];
int n, nans;
int gcd(int a, int b) {
  if (a < b) return gcd(b, a);
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n;
  memset(a, 0, sizeof(a));
  a[1] = 1;
  for (int i = 2; i <= n; ++i) {
    if (a[i] == 1) continue;
    ans[nans++] = i;
    for (int j = 1; j <= n; ++j) {
      int des = lcm(i, j);
      if (a[j] && des <= n) a[des] = 1;
    }
  }
  cout << nans << endl;
  if (nans != 0) cout << ans[0];
  for (int i = 1; i < nans; ++i) {
    cout << " " << ans[i];
  }
  cout << endl;
  return 0;
}
