#include <bits/stdc++.h>
using namespace std;
const int e = 100005;
const long long INF = 1e18 + 5;
template <typename T>
void show2(T &dp) {
  for (auto row : dp) {
    for (auto col : row) cout << col << " ";
    cout << "\n";
  }
}
template <typename T>
void show1(T &a) {
  for (auto x : a) cout << x << " ";
  cout << "\n";
}
int mx = 1000001;
vector<int> pr;
vector<int> lp(mx, 0);
void sieve() {
  for (int i = 2; i * i < mx; i++) {
    if (lp[i] == 0) {
      lp[i] = i;
      pr.push_back(i);
      for (int j = i * i; j <= mx; j += i) {
        lp[j] = i;
      }
    }
  }
}
void solve() {
  int n;
  cin >> n;
  sieve();
  vector<int> ans;
  for (int i : pr) {
    int temp = n;
    int val = i;
    while (val <= temp) {
      ans.push_back(val);
      val = val * i;
    }
  }
  cout << ans.size() << "\n";
  for (int y : ans) cout << y << " ";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  solve();
  return 0;
}
