#include <bits/stdc++.h>
using namespace std;
int cnt[1001];
vector<int> ans;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cnt[i] = i;
  }
  for (int i = 1; i <= n; i++) {
    if (cnt[i] > 1) {
      for (int j = i + i; j <= n; j += i) {
        cnt[j] /= cnt[i];
      }
      ans.push_back(i);
    }
  }
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
}
