#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int used[1005], n;
int main() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    if (!used[i]) {
      for (int j = i; j <= n; j *= i) {
        v.push_back(j);
      }
      for (int j = i; j <= n; j += i) {
        used[j] = 1;
      }
    }
  }
  cout << v.size() << endl;
  for (int i : v) {
    cout << i << " ";
  }
}
