#include <bits/stdc++.h>
using namespace std;
int prime(int n) {
  int val = sqrt(n), counter = 0;
  ;
  if (n == 1) return false;
  for (int i = 2; i <= val; i++) {
    if (!(n % i)) counter++;
  }
  if (counter) return -1;
  return n;
}
int root(int n) {
  int val = sqrt(n);
  int x = n, flag = 0;
  ;
  for (int i = 2; i <= val; i++) {
    if (!(n % i)) {
      while (n > 1) {
        if (n % i != 0) {
          flag = 1;
          break;
        }
        n = n / i;
      }
      if (flag) return -1;
      return x;
    }
  }
  return -1;
}
int main() {
  int n, counter = 0, val, val1;
  vector<int> vec;
  ;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    val = prime(i);
    val1 = root(i);
    if (val != -1) {
      counter++;
      vec.push_back(val);
    } else if (val1 != -1) {
      counter++;
      vec.push_back(val1);
    }
  }
  cout << counter << endl;
  for (int i = 0; i < counter; i++) cout << vec[i] << " ";
  cout << endl;
  return 0;
}
