#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<char> a(n + 1, true);
  a[0] = a[1] = false;
  for (int i = 2; i * i <= n; i++) {
    if (a[i]) {
      for (int j = i * i; j <= n; j += i) {
        a[j] = false;
      }
    }
  }
  vector<int> ans;
  int answ = 0;
  for (int i = 2; i <= n; i++) {
    if (a[i]) {
      ans.push_back(i);
      answ++;
      int b = i * i;
      while (b <= n) {
        ans.push_back(b);
        b *= i;
        answ++;
      }
    }
  }
  cout << answ << '\n';
  for (int i = 0; i < answ; i++) {
    cout << ans[i] << ' ';
  }
  return 0;
}
