#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool readInteger(T& x) {
  char c, r = 0, n = 0;
  x = 0;
  for (;;) {
    c = getchar();
    if ((c < 0) && (!r))
      return (0);
    else if ((c == '-') && (!r))
      n = 1;
    else if ((c >= '0') && (c <= '9'))
      x = x * 10 + c - '0', r = 1;
    else if (r)
      break;
  }
  if (n) x = -x;
  return (1);
}
const int MOD = 1000000007;
long long modPow(long long a, long long b, int mod = MOD) {
  assert(b >= 0);
  long long ret = 1 % mod;
  while (b) {
    if (b & 1) ret = ret * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ret;
}
int main() {
  int N;
  readInteger(N);
  vector<int> ret;
  for (int i = 2; i <= N; i++) {
    bool prime = true;
    for (int j = 2; j < i; j++)
      if (i % j == 0) prime = false;
    if (prime) {
      int x = i;
      while (x <= N) {
        ret.push_back(x);
        x *= i;
      }
    }
  }
  sort(ret.begin(), ret.end());
  printf("%d\n", (int)ret.size());
  for (auto& z : (ret)) printf("%d ", z);
  printf("\n");
}
