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