#include <bits/stdc++.h>
using namespace std;
const long long remi = 1000000007;
const long long remi2 = 998244353;
const long long inf = 1e18 + 1e17 + 1e16 + 1e15 + 1e14;
long long Pow(long long x, long long y, long long m) {
  if (y == 0) return 1;
  long long p = Pow(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j, k;
  int n;
  cin >> n;
  bool prime[n + 1];
  vector<int> pp;
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (int p = 2; p <= n; p++)
    if (prime[p]) pp.push_back(p);
  ;
  int sz = pp.size();
  set<int> ans;
  for (i = 0; i < sz; i++) {
    ans.insert(pp[i]);
  }
  int arr[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37};
  for (i = 2; i <= 10; i++) {
    j = 0;
    while (1) {
      int num = 1;
      int num2 = arr[j];
      for (k = 0; k < i; k++) {
        num = num * num2;
      }
      if (num > n)
        break;
      else
        ans.insert(num);
      j++;
    }
  }
  cout << ans.size() << "\n";
  for (auto i = ans.begin(); i != ans.end(); i++) {
    cout << *i << " ";
  }
}
