#include <bits/stdc++.h>
using namespace std;
bool isPrime(int n) {
  if (n <= 1) return false;
  for (int i = 2; i < n; i++)
    if (n % i == 0) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> v;
  if (n == 1) {
    cout << "0";
    return 0;
  }
  int temp;
  for (long long int i = (2); i <= (n); i++) {
    temp = i;
    if (isPrime(i)) {
      while (temp <= n) {
        v.push_back(temp);
        temp *= i;
      }
    }
  }
  cout << v.size() << endl;
  for (auto i = v.begin(); i != v.end(); i++) cout << *i << " ";
}
