#include <bits/stdc++.h>
using namespace std;
const int oo = 1 << 28;
const double err = 1e-8;
int n;
int a[1005];
bool usa[1005];
void init() {
  for (int i = 4; i < 1005; i += 2) a[i] = 2;
  for (int i = 3; i < 1005; i += 2) {
    if (!a[i]) {
      for (int j = i + i; j < 1005; j += i) a[j] = i;
    }
  }
}
vector<int> fact(int v) {
  vector<int> ret;
  set<int> tmp;
  while (a[v]) {
    tmp.insert(a[v]);
    v /= a[v];
  }
  tmp.insert(v);
  for (set<int>::iterator it = tmp.begin(); it != tmp.end(); it++)
    ret.push_back(*it);
  return ret;
}
map<int, bool> ma;
int main() {
  scanf("%d", &n);
  init();
  if (n == 1) {
    printf("0\n");
    return 0;
  } else if (n == 2) {
    printf("1\n2\n");
    return 0;
  } else {
    vector<int> sol;
    for (int i = 2; i <= n; i++) {
      vector<int> tt = fact(i);
      if (tt.size() == 1) sol.push_back(i);
    }
    printf("%d\n", sol.size());
    for (int i = 0; i < sol.size(); i++) printf("%d ", sol[i]);
    printf("\n");
  }
  return 0;
}
