#include <bits/stdc++.h>
using namespace std;
int a[1111], prime[1111], isprime[1111];
int num = 0;
void init() {
  for (int i = 2; i < 1111; i++) isprime[i] = 1;
  for (int i = 2; i < 1111; i++) {
    if (isprime[i]) {
      prime[num++] = i;
      for (int j = i * 2; j < 1001; j += i) isprime[j] = 0;
    }
  }
}
int main() {
  init();
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < num; i++) {
    int res = prime[i];
    while (res <= n) {
      a[ans++] = res;
      res *= prime[i];
    }
  }
  cout << ans << endl;
  if (ans == 0) return 0;
  for (int i = 0; i < ans - 1; i++) cout << a[i] << " ";
  cout << a[ans - 1] << endl;
}
