#include <bits/stdc++.h>
using namespace std;
template <typename T>
void getFoo(T &x) {
  x = 0;
  register char c = getchar_unlocked();
  for (; c < 48 || c > 57; c = getchar_unlocked())
    ;
  for (; c > 47 && c < 58; c = getchar_unlocked())
    x = (x << 1) + (x << 3) + c - 48;
}
template <typename T1, typename T2>
void getFoo(T1 &x, T2 &y) {
  getFoo(x);
  getFoo(y);
}
template <typename T1, typename T2, typename T3>
void getFoo(T1 &x, T2 &y, T3 &z) {
  getFoo(x);
  getFoo(y);
  getFoo(z);
}
inline void solve() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  getFoo(n);
  vector<int> primes;
  vector<int> ans;
  for (long long i = (2); i < (n + 1); ++i) {
    int cnt = 0;
    for (long long j = (1); j < (i + 1); ++j) {
      if (i % j == 0) ++cnt;
      if (cnt > 2) break;
    }
    if (cnt == 2) {
      int temp = i;
      while (temp <= n) {
        ans.push_back(temp);
        temp *= i;
      }
    }
  }
  printf("%d\n", ans.size());
  for (int x : ans) printf("%d ", x);
}
int main() {
  solve();
  return 0;
}
