#include <bits/stdc++.h>
using namespace std;
static int fast_io = []() {
  std::ios::sync_with_stdio(false);
  cin.tie(nullptr);
  return 0;
}();
int mypow(int base, int power) {
  if (power == 0) {
    return 1;
  }
  int res = 1;
  while (power > 1) {
    if (power & 1) {
      res *= base;
      power--;
    } else {
      base *= base;
      power /= 2;
    }
  }
  return base * res;
}
void count(int limit) {
  vector<bool> sieve(limit + 1);
  vector<bool> pmul(limit + 1);
  for (int i = 0; i < limit; i++) sieve[i] = false;
  sieve[2] = true;
  sieve[3] = true;
  for (int x = 1; x * x < limit; x++) {
    for (int y = 1; y * y < limit; y++) {
      int n = (4 * x * x) + (y * y);
      if (n <= limit && (n % 12 == 1 || n % 12 == 5)) sieve[n] = !sieve[n];
      n = (3 * x * x) + (y * y);
      if (n <= limit && n % 12 == 7) sieve[n] = !sieve[n];
      n = (3 * x * x) - (y * y);
      if (x > y && n <= limit && n % 12 == 11) sieve[n] = !sieve[n];
    }
  }
  for (int r = 5; r * r < limit; r++) {
    if (sieve[r]) {
      for (int i = r * r; i < limit; i += r * r) sieve[i] = false;
    }
  }
  for (int i = 2; i < limit; i++) {
    if (sieve[i]) {
      for (int j = 2; mypow(i, j) < limit; j++) {
        pmul[mypow(i, j)] = true;
      }
    }
  }
  int ans = 0;
  for (int a = 2; a < limit; a++) {
    if (sieve[a] || pmul[a]) {
      ++ans;
    }
  }
  cout << ans << "\n";
  for (int a = 2; a < limit; a++) {
    if (sieve[a] || pmul[a]) {
      cout << a << " ";
    }
  }
}
int main() {
  int n;
  cin >> n;
  count(n + 1);
  return 0;
}
