#include <bits/stdc++.h>
using namespace std;
bool ans[1001];
bool pr[1001];
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  for (int num = 2; num <= n; num++) {
    int cur = num;
    bool stop = false;
    for (int i = 2; i * i <= num; i++) {
      if (pr[i] && num % i == 0) {
        stop = true;
        break;
      }
    }
    if (stop) continue;
    pr[cur] = true;
    while (cur <= n) {
      ans[cur] = true;
      cur *= num;
    }
  }
  int size = 0;
  for (int i = 2; i < 1001; i++) {
    if (ans[i]) size++;
  }
  cout << size << endl;
  for (int i = 2; i < 1001; i++) {
    if (ans[i]) cout << i << " ";
  }
  return 0;
}
