#include <bits/stdc++.h>
using namespace std;
bool prime[1009];
int main() {
  int n;
  vector<int> ret;
  cin >> n;
  for (int i = 2; i * i <= n; i++)
    if (!prime[i])
      for (int j = i * 2; j <= n; j += i) prime[j] = 1;
  for (int i = 2; i <= n; i++)
    if (!prime[i]) {
      int tmp = i;
      while (tmp <= n) ret.push_back(tmp), tmp *= i;
    }
  cout << ret.size() << endl;
  for (int i = 0; i < (int)ret.size(); i++)
    cout << ret[i] << " \n"[i == ret.size() - 1];
}
