#include <bits/stdc++.h>
using namespace std;
const int maxn = 1003;
vector<int> d;
bool used[maxn];
bool check(int x) {
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0) return false;
  return true;
}
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++)
    if (check(i)) {
      int out = i;
      while (out <= n) {
        d.push_back(out);
        out *= i;
      }
    }
  cout << (int)d.size() << endl;
  for (int i = 0; i < (int)d.size(); i++) cout << d[i] << ' ';
  return 0;
}
