#include <bits/stdc++.h>
using namespace std;
int n, p[1234];
vector<int> ans;
int main() {
  cin >> n;
  for (int i = 2; i <= n; ++i) {
    if (p[i] == 0) {
      for (int j = i + i; j <= n; j += i) p[j] = 1;
      for (int j = i; j <= n; j *= i) ans.push_back(j);
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); ++i) cout << ans[i] << " ";
  return 0;
}
