#include <bits/stdc++.h>
using namespace std;
bool arr[1010];
vector<int> a;
void markMultiples(bool arr[], int a, int n) {
  int i = 2, num;
  while ((num = i * a) <= n) {
    arr[num - 1] = 1;
    ++i;
  }
}
long long ans = 0;
void SieveOfEratosthenes(int n) {
  if (n >= 2) {
    for (int i = 1; i < n; ++i) {
      if (arr[i] == 0) {
        long long prime = i + 1;
        long long tmp = prime;
        ans++;
        a.push_back(tmp);
        while (tmp * prime <= n) {
          ans++;
          tmp = tmp * prime;
          a.push_back(tmp);
        }
        markMultiples(arr, i + 1, n);
      }
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  SieveOfEratosthenes(n);
  cout << ans << endl;
  for (int i = 0; i < ans; i++) {
    cout << a[i] << " ";
  }
  return 0;
}
