#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
bool arr[1001];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) arr[i] = 1;
  for (int i = 2; i <= n; i++) {
    if (arr[i]) {
      for (int j = 2 * i; j <= n; j += i) {
        arr[j] = 0;
      }
      for (int j = i; j <= n; j *= i) {
        ans.push_back(j);
      }
    }
  }
  printf("%d\n", ans.size());
  for (int j = 0; j < ans.size(); j++) {
    printf("%d ", ans[j]);
  }
  printf("\n");
  return 0;
}
