#include <bits/stdc++.h>
using namespace std;
const int N = 1e3;
int n;
bool mark[N + 2];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 2; i <= n; i++) mark[i] = 1;
  vector<int> res;
  for (int i = 2; i <= n; i++) {
    if (!mark[i]) continue;
    for (int j = i + i; j <= n; j += i) mark[j] = 0;
    for (int j = i; j <= n; j *= i) res.push_back(j);
  }
  cout << res.size() << '\n';
  for (int i : res) {
    cout << i << ' ';
  }
  cout << '\n';
  return 0;
}
