#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d[100001], ct, e = 1e6, f, g, j, arr[112345], mx, it, sum,
                                  mn, ans;
bool k[1123];
string s = "YES", n = "NO";
int main() {
  cin >> a;
  for (int i = 6; i < 1100; i++) {
    set<int> st;
    b = 2;
    c = i;
    while (c > 1) {
      while (c % b == 0) {
        st.insert(b);
        c /= b;
      }
      b++;
    }
    if (st.size() > 1) k[i] = true;
  }
  for (int i = 2; i <= a; i++) {
    if (k[i] == false) ct++;
  }
  cout << ct << endl;
  for (int i = 2; i <= a; i++) {
    if (k[i] == false) cout << i << " ";
  }
  return 0;
}
