#include <bits/stdc++.h>
using namespace std;
bool vis[1000 + 10];
int pri[1000 + 10];
int siz = 0;
int N = 1000 + 10;
void sieve() {
  for (long long i = 2; i * i < N; i++) {
    if (!vis[i]) {
      for (long long j = i * i; j < N; j += i) {
        vis[j] = true;
      }
    }
  }
  for (int i = 2; i < N; i++) {
    if (!vis[i]) pri[siz++] = i;
  }
}
vector<int> v;
bool here[1000 + 10];
bool re[1000 + 10];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  sieve();
  int n, m, k, d, f, h, tem1, tem2, tem3, sum = 0, ans = 0;
  string s, c;
  cin >> n;
  for (int i = 0; i < siz && pri[i] <= n; i++) {
    v.push_back(pri[i]);
    for (int j = 2; pri[i] * j <= n; j++) {
      m = j * pri[i];
      if (!here[m]) {
        here[m] = true;
        v.push_back(m);
      } else {
        re[m] = true;
      }
    }
  }
  for (int i = 0; i <= n; i++) {
    if (re[i]) sum++;
  }
  cout << v.size() - sum << "\n";
  for (int i = 0; i < v.size(); i++) {
    if (!re[v[i]]) cout << v[i] << " ";
  }
  return 0;
}
