#include <bits/stdc++.h>
using namespace std;
bool singleFactor[1001];
int LPF[1001];
int main() {
  for (int i = 2; i <= 1000; i++) LPF[i] = -1;
  for (int i = 2; i * i <= 1000; i++) {
    if (LPF[i] == -1) {
      LPF[i] = i;
      for (int j = i * i; j <= 1000; j += i) {
        LPF[j] = i;
      }
    }
  }
  for (int i = 2; i <= 1000; i++) {
    unordered_set<int> Factors;
    int j = i;
    while (j > 1) {
      Factors.insert(LPF[j]);
      j /= LPF[j];
    }
    if (Factors.size() == 1) {
      singleFactor[i] = true;
    }
  }
  int n;
  cin >> n;
  vector<int> arr;
  for (int i = 2; i <= n; i++) {
    if (singleFactor[i]) {
      arr.push_back(i);
    }
  }
  cout << arr.size() << '\n';
  for (int i : arr) cout << i << ' ';
}
