#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, f, t, i, j, x, y, sum = 0, ans = 0,
                                     maxx = -1000000000000000000;
  cin >> n;
  vector<long long> v;
  for (i = 2; i < n + 1; i++) {
    f = 1;
    for (j = 2; j * j <= i; j++)
      if (i % j == 0) {
        f = 0;
        break;
      }
    if (f) {
      j = i;
      while (j <= n) {
        v.push_back(j);
        j *= i;
      }
    }
  }
  cout << v.size() << "\n";
  for (i = 0; i < v.size(); i++) cout << v[i] << " ";
}
