#include <bits/stdc++.h>
using namespace std;
vector<int> res;
bool flag[1005];
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    if (flag[i] == false) {
      for (int j = i; j <= n; j += i) {
        flag[j] = true;
      }
      for (int j = i; j <= n; j *= i) {
        res.push_back(j);
      }
    }
  }
  cout << res.size() << endl;
  for (int i = 0; i < res.size(); i++) {
    cout << res[i] << " ";
  }
  return 0;
}
