#include <bits/stdc++.h>
using namespace std;
namespace stuff {
const int MOD = int(1e9) + 7;
bool is_prime(int x) {
  for (int i = 2; i * i <= x; ++i) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}
void solve(int test_num) {
  int N;
  cin >> N;
  vector<int> res;
  for (int x = 2; x <= N; ++x) {
    if (is_prime(x)) {
      int t = x;
      while (t <= N) {
        res.push_back(t);
        t *= x;
      }
    }
  }
  cout << res.size() << endl;
  for (const int& x : res) {
    cout << x << " ";
  }
  cout << endl;
}
void solve() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  for (int t = 1; t <= T; t++) solve(t);
}
}  // namespace stuff
int main() {
  stuff::solve();
  return 0;
}
