#include <bits/stdc++.h>
using namespace std;
int a[10005] = {0};
int main() {
  int n, k;
  cin >> n;
  a[0] = a[1] = 1;
  for (int i = 2; i * i <= n; i++) {
    if (!a[i]) {
      k = i;
      for (int j = i * 2; j <= n; j += i) {
        a[j] = 1;
      }
    }
  }
  for (int i = 2; i * i <= n; i++) {
    if (a[i] == 0) {
      for (int j = i * i; j <= n; j *= i) a[j] = 0;
    }
  }
  int cnt = 0;
  vector<int> ans;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      cnt++;
    }
  }
  cout << cnt << endl;
  for (int i = 1; i <= n; i++)
    if (a[i] == 0) cout << i << ' ';
  return 0;
}
