#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long N = 7e4 + 7;
const double dif = 1e-6;
long long n, m, t;
bool is_Prime(int n) {
  if (n == 2) return true;
  if (n % 2 == 0 || n == 1) return false;
  for (int i = 3; i * i <= n; i += 2) {
    if (n % i == 0) return false;
  }
  return true;
}
vector<long long> v;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 2; i <= n; i++) {
    if (is_Prime(i)) {
      v.push_back(i);
      for (long long j = i * i; j <= n; j *= i) v.push_back(j);
    }
  }
  cout << v.size() << '\n';
  for (int i = 0; i < v.size(); i++) cout << v[i] << ' ';
  return 0;
}
