#include <bits/stdc++.h>
using namespace std;
vector<int> v;
vector<int> ans;
bool IsPrime(int n) {
  if (n < 2) return false;
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++)
    if (IsPrime(i)) v.push_back(i);
  for (int i = 0; i < v.size(); i++) {
    int num = v[i];
    while (num <= n) {
      ans.push_back(num);
      num *= v[i];
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
