#include <bits/stdc++.h>
using namespace std;
long long G(long long a, long long b) {
  if (b == 0) return a;
  return G(b, a % b);
}
bool mark[1111];
vector<int> v;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    if (!mark[i]) {
      int k = i;
      while (k <= n) {
        v.push_back(k);
        k *= i;
      }
      for (int j = i * 2; j <= n; j += i) mark[j] = 1;
    }
  }
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
}
