#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int n;
vector<bool> vis(1005, false);
void seive() {
  int k = sqrt(n), i, j;
  for (i = 2; i <= k; i++) {
    for (j = i * i; j <= n; j += i) {
      vis[j] = true;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  seive();
  vector<int> v;
  for (int i = 2; i <= n; i++) {
    if (!vis[i]) {
      for (int k = i; k <= n; k *= i) v.push_back(k);
    }
  }
  cout << v.size() << "\n";
  for (auto j : v) cout << j << " ";
  return 0;
}
