#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
bool imposs[maxn];
vector<int> ans, v;
set<int> st;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int main() {
  int n;
  scanf("%d", &n);
  memset(imposs, 0, sizeof(imposs));
  for (int j = 2; j <= n; j++) {
    if (!imposs[j]) {
      for (set<int>::iterator it = st.begin(); it != st.end(); it++) {
        int tp = lcm(*it, j);
        if (tp <= n & !st.count(tp)) v.push_back(tp);
      }
      for (int i = 0; i < v.size(); i++) {
        st.insert(v[i]);
        imposs[v[i]] = 1;
      }
      st.insert(j);
      ans.push_back(j);
    }
  }
  printf("%d\n", (int)ans.size());
  for (int i = 0; i < ans.size(); i++) {
    if (i != 0) printf(" ");
    printf("%d", ans[i]);
  }
  printf("\n");
  return 0;
}
