#include <bits/stdc++.h>
using namespace std;
const int maxN = 1000 + 10;
int n, flag, a[maxN], i, j, m;
int main() {
  cin >> n;
  for (i = 2; i <= n; i++) {
    for (j = 2; j * j <= i; j++) {
      if (i != j && i % j == 0) flag = 1;
    }
    j = i;
    while (flag == 0 && j <= n) {
      a[m++] = j;
      j *= i;
    }
    flag = 0;
  }
  cout << m << endl;
  for (int k = 0; k < m; k++) cout << a[k] << ' ';
  return 0;
}
