#include <bits/stdc++.h>
using namespace std;
double PI = 3.1415926536;
int dX[] = {1, -1, 0, 0};
int dY[] = {0, 0, 1, -1};
bitset<1000> bs;
void Sieve() {
  bs.set();
  bs[0] = 0, bs[1] = 0;
  for (long long i = 2; i <= 1000; i++)
    if (bs[i]) {
      for (long long j = i * i; j <= 1000; j += i) bs[j] = 0;
    }
}
int main() {
  int n;
  scanf("%d", &n);
  Sieve();
  vector<int> res;
  for (int i = (2); i < (n + 1); i++) {
    if (bs[i]) {
      int x = i;
      while (x <= n) res.push_back(x), x *= i;
    }
  }
  printf("%d\n", (int)res.size());
  for (int i = 0; i < (int)res.size(); i++) printf("%d ", res[i]);
}
