#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[1004];
  int c = 0;
  for (int i = 2; i <= n; i++) {
    bool f = 0;
    for (int j = 2; j * j <= i; j++)
      if (i % j == 0) f = 1;
    int j = i;
    while (!f && j <= n) {
      a[c++] = j;
      j *= i;
    }
  }
  cout << c << endl;
  for (int i = 0; i < c; i++) cout << a[i] << " ";
}
