#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:200000000")
using namespace std;
const int cs = 0x186A1;
const int up = 1001;
int n, ans;
int u[1005];
vector<int> p, s;
int main() {
  for (int i = 2; i < up; i++)
    if (!u[i])
      for (int j = i * i; j < up; j += i) u[j] = 1;
  for (int i = 2; i < up; i++)
    if (!u[i]) p.push_back(i);
  cin >> n;
  for (auto i : p) {
    int cur = i;
    while (cur <= n) {
      s.push_back(cur);
      cur *= i;
    }
  }
  cout << s.size() << endl;
  for (auto i : s) cout << i << " ";
  return 0;
}
