#include <bits/stdc++.h>
using namespace std;
inline void in(int &n) {
  n = 0;
  int ch = getchar();
  int sign = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') sign = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    n = (n << 3) + (n << 1) + ch - '0', ch = getchar();
  }
  n = n * sign;
}
int a[1000 + 5];
vector<int> prime;
void pre() {
  int t;
  t = 2;
  prime.push_back(2);
  prime.push_back(3);
  for (int i = 5; i * i <= 1000;) {
    if (a[i] == 0) {
      for (int j = i * i; j <= 1000; j = j + i + i) {
        a[j] = 1;
      }
    }
    i = i + t;
    t = 6 - t;
  }
  t = 2;
  for (int i = 5; i <= 1000;) {
    if (a[i] == 0) {
      prime.push_back(i);
    }
    i = i + t;
    t = 6 - t;
  }
}
int main() {
  pre();
  int n;
  in(n);
  vector<int> ans;
  for (int i = 0; i < prime.size(); i++) {
    int tmp = prime[i];
    while (tmp <= n) {
      ans.push_back(tmp);
      tmp *= prime[i];
    }
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) {
    printf("%d ", ans[i]);
  }
  printf("\n");
  return 0;
}
