#include <bits/stdc++.h>
using namespace std;
bool used[100011], usd[1000011];
vector<int> a;
int pw(int x, int y) {
  int k = x;
  for (int i = 2; i <= y; i++) {
    x *= k;
  }
  return x;
}
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    if (!used[i]) {
      a.push_back(i);
      for (int j = i + i; j <= n; j += i) {
        used[j] = 1;
      }
    }
  }
  int h = a.size();
  for (int i = 0; i < h; i++) {
    for (int j = 2; pw(a[i], j) <= n; j++) {
      a.push_back(pw(a[i], j));
    }
  }
  cout << a.size() << " ";
  for (int i = 0; i < a.size(); i++) {
    cout << a[i] << " ";
  }
  return 0;
}
