#include <bits/stdc++.h>
using namespace std;
const int N = 300010;
bool inseg[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  set<int> v;
  for (int i = 2; i <= n; i++) {
    bool prime = true;
    for (int j = 2; j * j <= i; j++) {
      if (i % j == 0) {
        prime = false;
        break;
      }
    }
    if (prime) {
      for (int j = 1; pow(i, j) <= n; j++) {
        v.insert(pow(i, j));
      }
    }
  }
  cout << v.size() << "\n";
  for (auto a : v) {
    cout << a << " ";
  }
  return 0;
}
