#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1003;
vector<int> dziel[MAXN], dif[MAXN], ans;
bool bylo[MAXN];
int nwd(int a, int b) { return b == 0 ? a : nwd(b, a % b); }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j * j <= i; j++) {
      if (i % j == 0) {
        if (j * j == i)
          dziel[i].push_back(j);
        else if (j == 1)
          dziel[i].push_back(i);
        else {
          dziel[i].push_back(j);
          dziel[i].push_back(i / j);
        }
      }
    }
    sort(dziel[i].begin(), dziel[i].end());
  }
  long long iloczyn = 1, p;
  for (int i = 2; i <= n; i++) {
    iloczyn = 1;
    for (int j = 0; j < dif[i].size() && iloczyn < i; j++) {
      p = nwd(iloczyn, dif[i][j]);
      iloczyn = (iloczyn * dif[i][j]) / p;
    }
    if (iloczyn < i) {
      ans.push_back(i);
      bylo[i] = 1;
      for (int j = i; j <= n; j += i) {
        dif[j].push_back(i);
      }
    }
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) printf("%d ", ans[i]);
  return 0;
}
