#include <bits/stdc++.h>
using namespace std;
long long int arr[2222222];
long long int a[2222222];
long long int dp[7333];
void f() {
  for (long long int i = 1; i <= 1000; i++) dp[i] = 1;
  dp[1] = 0;
  for (long long int i = 2; i * i <= 1000; i++) {
    if (dp[i] == 0) continue;
    for (long long int j = i * i; j <= 1000; j += i) dp[j] = 0;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  long long int n;
  f();
  long long int ans = 0;
  vector<long long int> v;
  cin >> n;
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  for (long long int i = 1; i <= n; i++) {
    if (dp[i] == 0) continue;
    long long int I = i;
    while (I <= n) {
      v.push_back(I);
      I *= i;
    }
  }
  ans = v.size();
  cout << ans << endl;
  for (long long int i = 0; i < ans; i++) cout << v[i] << " ";
  cout << endl;
  return 0;
}
