#include <bits/stdc++.h>
using namespace std;
bool vis[1007];
void Sieve() {
  vis[0] = vis[1] = 1;
  for (int i = 2; i < 1007; i++) {
    if (!vis[i]) {
      for (int j = i + i; j < 1007; j += i) vis[j] = 1;
    }
  }
}
int main() {
  Sieve();
  int n;
  cin >> n;
  vector<int> ans;
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      int x = 1;
      while (x * i <= n) {
        x *= i;
        ans.push_back(x);
      }
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
