#include <bits/stdc++.h>
using namespace std;
bool usa[1005];
bool pk[1005];
vector<int> sol;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    if (!usa[i]) {
      int j = i;
      while (i * j <= n) {
        usa[i * j] = true;
        j++;
      }
      int k = i, pot = i;
      while (pot <= n) {
        pk[pot] = true;
        pot *= k;
      }
    }
  }
  int cont = 0;
  for (int i = 2; i <= n; i++) {
    if (pk[i]) {
      sol.push_back(i);
      cont++;
    }
  }
  printf("%d\n", cont);
  for (int i = 0; i < cont; i++) printf("%d ", sol[i]);
  printf("\n");
  return 0;
}
