#include <bits/stdc++.h>
using namespace std;
bool is_prime_power(int x) {
  int ld = 0;
  for (int i = 2; i <= x; i++)
    if (x % i == 0) {
      if (ld == 0)
        ld = i;
      else if (i % ld != 0)
        return false;
    }
  return true;
}
int main() {
  int n;
  cin >> n;
  vector<int> ans;
  for (int i = 2; i <= n; i++)
    if (is_prime_power(i)) ans.push_back(i);
  cout << ans.size() << endl;
  for (int x : ans) cout << x << ' ';
  cout << endl;
  return 0;
}
