#include <bits/stdc++.h>
using namespace std;
bool siv[1001];
vector<int> prime;
void seave(int n) {
  int i = 2;
  prime.push_back(2);
  while (2 * i <= n) {
    siv[2 * i] = 1;
    i++;
  }
  for (int j = 3; j <= n; j += 2) {
    if (siv[j] == 0) {
      int k = 2;
      prime.push_back(j);
      while (k * j <= n) {
        siv[j * k] = 1;
        k++;
      }
    }
  }
}
int main() {
  int n;
  cin >> n;
  seave(n);
  vector<int> ans;
  for (int i = 0; i < prime.size(); i++) {
    int b = prime[i];
    while (b <= n) {
      ans.push_back(b);
      b = b * prime[i];
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  cout << endl;
}
