#include <bits/stdc++.h>
using namespace std;
const int dx[] = {0, 0, -1, 1, 1, -1, -1, 1};
const int dy[] = {-1, 1, 0, 0, -1, 1, -1, 1};
const int MOD = 1000000007;
const int N = 1e5 + 50;
const long long OO = 100000000;
bool prime[1005];
void seive() {
  prime[0] = 1;
  prime[1] = 1;
  for (int i = 2; i < 1005; i++)
    if (!prime[i]) {
      for (int j = i + i; j < 1005; j += i) {
        prime[j] = 1;
      }
    }
}
int main() {
  int x;
  cin >> x;
  seive();
  vector<int> ans;
  for (int i = 1; i <= x; ++i) {
    if (!prime[i]) {
      int k = 1;
      while (pow(i, k) <= x) {
        ans.push_back(pow(i, k));
        k++;
      }
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); ++i) {
    cout << ans[i] << " ";
  }
  return 0;
}
