#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
long long t, m, a[N], b[N], n, ans = 0, q, z;
int main() {
  cin >> n;
  m = 0;
  for (int j, i = 2; i <= n; i++) {
    q = 0;
    for (j = 2; j * j <= i; j++)
      if (i % j == 0) q = 1;
    j = i;
    while (!q && j <= n) {
      a[m++] = j;
      j *= i;
    }
  }
  cout << m << endl;
  for (int i = 0; i < m; i++) cout << a[i] << " ";
  return 0;
}
