#include <bits/stdc++.h>
using namespace std;
bool vis[2000];
vector<int> prime, ans;
int main() {
  for (int i = 2; i <= 1010; i++) {
    if (vis[i] == false) {
      prime.push_back(i);
      for (int j = i; j <= 1010; j += i) vis[j] = true;
    }
  }
  int n, num;
  cin >> n;
  for (int i = 0; i < prime.size(); i++) {
    num = prime[i];
    while (num <= n) {
      ans.push_back(num);
      num *= prime[i];
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  return 0;
}
