#include <bits/stdc++.h>
using namespace std;
const int mod = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 123;
const int N = 1e6 + 123;
const int INF = 1e9 + 1;
const long long INFL = 3e18 + 1;
const double pi = acos(-1.0);
const double eps = 1e-9;
int n;
bool used[1001];
vector<int> ans;
inline void boost() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
}
inline void solve() {
  boost();
  cin >> n;
  for (int i = 2; i <= n; i++)
    if (!used[i])
      for (int j = i * i; j <= n; j += i) used[j] = 1;
  for (int i = 2; i <= n; i++) {
    if (!used[i]) {
      ans.push_back(i);
      for (int j = i * i; j <= n; j *= i) ans.push_back(j);
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
}
int main() { solve(); }
