#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
int print_value(A title, B val) {
  cout << title << " = " << val << "\n";
  return 1;
}
int break_point() {
  char c;
  while ((c = getchar()) != '\n')
    ;
  return 0;
}
template <typename A>
int logg(A v) {
  cout << v << "\n";
  return 0;
}
void read_intq(int &r) {
  r = 0;
  char c;
  while (1) {
    c = getchar();
    if (c != ' ' && c != '\n') {
      r = c - '0';
      break;
    }
  }
  while (1) {
    c = getchar();
    if (c == ' ' || c == '\n') return;
    r = r * 10 + (c - '0');
  }
}
void read_llq(long long &r) {
  r = 0;
  char c;
  while (1) {
    c = getchar();
    if (c != ' ' && c != '\n') {
      r = c - '0';
      break;
    }
  }
  while (1) {
    c = getchar();
    if (c == ' ' || c == '\n') return;
    r = r * 10 + (c - '0');
  }
}
char get_char() {
  char c;
  while (1) {
    c = getchar();
    if (c != '\n' && c != ' ') return c;
  }
}
void run();
int main() {
  srand(time(NULL));
  do {
    run();
    if (0) {
      0 ? printf("-------------------------------\n") : 0;
      0 ? printf("-------------------------------\n") : 0;
    }
  } while (0);
  return 0;
}
vector<int> res;
bool u[1003];
int lp[1003];
vector<int> pr;
void run() {
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    if (lp[i] == 0) {
      lp[i] = i;
      pr.push_back(i);
    }
    for (int j = 0; j < pr.size() && pr[j] * i <= n && lp[i] >= pr[j]; j++)
      lp[i * pr[j]] = pr[j];
  }
  int sz = pr.size();
  for (int j = 0; j < sz; j++) {
    int t = pr[j];
    while (t <= n) {
      res.push_back(t);
      u[t] = 1;
      t *= pr[j];
    }
  }
  sz = res.size();
  printf("%d", sz);
  putchar('\n');
  for (int i = 0; i < sz; i++) {
    printf("%d", res[i]);
    putchar(' ');
  }
  putchar('\n');
}
