#include <bits/stdc++.h>
using namespace std;
int metka[100009];
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= n; ++i) {
    bool is = false;
    for (int j = 2; j < i; ++j)
      if (i % j == 0) is = true;
    if (is) continue;
    for (int j = i; j <= n; j *= i) {
      metka[j] = 1;
    }
  }
  int cnt = 0;
  for (int i = 2; i <= n; ++i)
    if (metka[i]) cnt++;
  cout << cnt << "\n";
  for (int i = 2; i <= n; ++i)
    if (metka[i]) cout << i << " ";
  cout << "\n";
  return 0;
}
