#include <bits/stdc++.h>
using namespace std;
bool prime(int k) {
  if (k == 2) return true;
  if (k % 2 == 0) return false;
  for (int i = 3; i * i <= k; i += 2)
    if (k % i == 0) return false;
  return true;
}
int main() {
  int n;
  scanf("%d", &n);
  vector<int> res;
  for (int i = 2; i <= n; i++) {
    if (prime(i)) {
      int temp = i;
      while (temp <= n) {
        res.push_back(temp);
        temp *= i;
      }
    }
  }
  printf("%d\n", res.size());
  for (int i : res) printf("%d ", i);
}
