#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
long long a[N], b[N] = {0};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  set<long long> s;
  for (long long i = 2; i <= n; i++) {
    if (!b[i]) {
      for (long long j = 2 * i; j <= n; j += i) {
        b[j] = 1;
      }
      for (long long j = i; j <= n; j *= i) {
        s.insert(j);
      }
    }
  }
  cout << s.size() << endl;
  for (auto it : s) cout << it << ' ';
}
