#include <bits/stdc++.h>
using namespace std;
int ck[1024];
int main() {
  int n;
  scanf("%d", &n);
  vector<int> ans;
  if (n == 1) {
    printf("0\n");
    return 0;
  } else {
    for (int i = 2; i <= n; i++)
      if (!ck[i]) {
        for (int j = i * i; j <= n; j += i) ck[j] = 1;
        int j = i;
        while (j <= n) {
          ans.push_back(j);
          j *= i;
        }
      }
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < int(ans.size()); i++) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}
