#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5;
int n;
bool p[N];
vector<int> ans;
int main() {
  cin >> n;
  for (int i = 2; i <= n; i++)
    if (!p[i])
      for (int j = i + i; j <= n; j += i) p[j] = 1;
  for (int i = 2; i <= n; i++)
    if (!p[i]) {
      int q = 1;
      while (q <= n / i) {
        q *= i;
        ans.push_back(q);
      }
    }
  cout << ans.size() << endl;
  for (auto i : ans) cout << i << " ";
  return 0;
}
