#include <bits/stdc++.h>
using namespace std;
bool iscp[1100];
vector<int> prime;
void create() {
  for (int i = 2; i < 1100; i++)
    if (!iscp[i]) {
      prime.push_back(i);
      if (i > 1000) return;
      for (int j = i + i; j < 1100; j += i) iscp[j] = 1;
    }
}
vector<int> bx;
int main() {
  create();
  int n;
  scanf("%d", &n);
  int len = prime.size();
  for (int i = 0; i < len && prime[i] <= n; i++)
    for (int j = prime[i]; j <= n; j *= prime[i]) bx.push_back(j);
  len = int(bx.size());
  printf("%d\n", len);
  for (int i = 0; i < len; i++) {
    if (i) putchar(' ');
    printf("%d", bx[i]);
  }
}
