#include <bits/stdc++.h>
using namespace std;
int p[1005];
void sieve() {
  int i;
  p[0] = 1;
  p[1] = 1;
  p[2] = 0;
  for (i = 2; i <= sqrt(1000); i++) {
    int j = 2, num;
    while ((num = i * j) <= 1000) {
      p[num] = 1;
      j++;
    }
  }
}
int main() {
  sieve();
  int n;
  scanf("%d", &n);
  vector<int> v;
  int i;
  for (i = 2; i <= n; i++) {
    if (p[i] == 0) {
      int tmp = i;
      while (tmp <= n) {
        v.push_back(tmp);
        tmp *= i;
      }
    }
  }
  cout << v.size() << endl;
  for (i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << endl;
  return 0;
}
