#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr[1001] = {0};
  for (int i = 2; i < 1001; i++) {
    if (arr[i] == 0) {
      for (int j = i * i; j < 1001; j += i) arr[j] = 1;
    }
  }
  vector<int> pr;
  for (int i = 2; i < 1001; i++)
    if (arr[i] == 0) pr.push_back(i);
  int n;
  cin >> n;
  vector<int> ans;
  for (auto u : pr) {
    if (u > n)
      break;
    else {
      int j = u;
      while (j <= n) {
        ans.push_back(j);
        j = j * u;
      }
    }
  }
  cout << ans.size() << endl;
  for (auto u : ans) cout << u << ' ';
  cout << endl;
  return 0;
}
