#include <bits/stdc++.h>
using namespace std;
long long int power(long long int a, long long int b) {
  long long int res = 1;
  a = a % 1000000007;
  while (b > 0) {
    if (b & 1) {
      res = (res * a) % 1000000007;
      b--;
    }
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  return (b == 0) ? a : gcd(b, a % b);
}
vector<long long int> prime;
vector<long long int> vis(2000, 0);
void sieve(long long int n) {
  for (long long int i = 2; i <= n; i++) {
    if (vis[i] == 0) {
      prime.push_back(i);
      for (long long int j = i * i; j <= n; j += i) vis[j] = 1;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  sieve(n);
  vector<long long int> ans;
  for (auto i : prime) {
    long long int c = n / i;
    long long int e = i;
    while (e <= n) {
      ans.push_back(e);
      e = e * i;
    }
  }
  cout << ans.size() << "\n";
  for (auto i : ans) cout << i << " ";
}
