#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int ans = 0;
  vector<int> v;
  unordered_map<int, int> m;
  for (int i = 2; i <= n; i++) {
    if (m[i] == 0) {
      ++ans;
      v.push_back(i);
      for (int j = i * i; j <= n; j = j + i) m[j] = 1;
      int p = i;
      while (i * p <= n) {
        ++ans;
        p = i * p;
        v.push_back(p);
      }
    }
  }
  cout << ans << endl;
  for (auto ele : v) cout << ele << " ";
  return 0;
}
