#include <bits/stdc++.h>
using namespace std;
bool isprime[1010];
void prim() {
  for (int i = 2; i <= 1005; i++) {
    isprime[i] = 1;
  }
  for (int i = 2; i <= 1005; i++) {
    if (isprime[i]) {
      for (int j = 2 * i; j <= 1005; j += i) {
        isprime[j] = 0;
      }
    }
  }
}
int main() {
  int n;
  cin >> n;
  int cnt = 0;
  prim();
  for (int i = 2; i <= n; i++) {
    if (isprime[i]) {
      int tmp = i;
      while (tmp <= n) {
        cnt++;
        tmp *= i;
      }
    }
  }
  cout << cnt << endl;
  for (int i = 2; i <= n; i++) {
    if (isprime[i]) {
      int tmp = i;
      while (tmp <= n) {
        cout << tmp << " ";
        tmp *= i;
      }
    }
  }
  return 0;
}
