#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  set<int> st;
  for (int i = 2; i <= n; i++) {
    int a = i;
    for (int j = 2; j * j <= a; j++) {
      int num = 1;
      while (a % j == 0 and a > 1) {
        a /= j;
        num *= j;
      }
      if (num != 1) st.insert(num);
    }
    if (a > 1) st.insert(a);
  }
  cout << st.size() << endl;
  for (auto item : st) cout << item << " ";
}
