#include <bits/stdc++.h>
using namespace std;
long long int isPrime(long long int n) {
  if (n == 0 || n == 1) return 0;
  if (n % 2 == 0) return (long long int)2;
  if (n % 3 == 0)
    return (long long int)3;
  else {
    for (long long int i = 5; i * i <= n; i += 6) {
      if (n % i == 0) return i;
      if (n % (i + 2) == 0) return (i + 2);
    }
    return n;
  }
}
bool sec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
long long int binary_exp(long long int a, long long int n) {
  long long int i = 1;
  while (n > 0) {
    if (n % 2 == 1) i = (i * a) % 998244353;
    a = (a * a) % 998244353;
    n /= 2;
  }
  return i;
}
long long int Upper_Bound(long long int n) {
  if (n == 0 || n == 1) return 0;
  long long int low = 1, high = 1e10, mid, i;
  while (low < high) {
    mid = (low + high + 1) / 2;
    i = (mid * (mid + 1)) / 2;
    if (i >= n)
      high = mid;
    else
      low = mid + 1;
  }
  return low;
}
bool isPalindrome(string s) {
  int i, n = s.length();
  for (i = 0; i < n / 2; i++) {
    if (s[i] != s[n - i - 1]) return false;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  int n, i, j, k;
  cin >> n;
  vector<int> ans;
  for (i = 2; i <= n; i++) {
    if (isPrime(i) == i) {
      j = i;
      while (j <= n) {
        ans.push_back(j);
        j *= i;
      }
    }
  }
  cout << ans.size() << endl;
  for (i = 0; i < ans.size(); i++) cout << ans[i] << " ";
}
