#include <bits/stdc++.h>
using namespace std;
int const N = 2e6 + 1;
long long n, x, y, z = 0, m = 0, mod = 1e9 + 7, sum1 = 0, sum2 = 0, ans = 0;
string s;
map<int, int> mp;
set<int> se;
set<int>::iterator st;
bool isprime[N];
bool vis[N];
int main() {
  cin >> x;
  isprime[0] = isprime[1] = true;
  for (int i = 2; i <= x; i++) {
    for (int j = i * i; j <= x; j += i) isprime[j] = true;
  }
  for (int i = 2; i <= x; i++) {
    bool f = 0;
    vector<int> v;
    n = i;
    map<int, int> frq;
    for (int j = 2; j <= i; j++) {
      if (isprime[j]) continue;
      if (n == 0) break;
      while (n % j == 0) {
        frq[j]++;
        n /= j;
      }
    }
    for (map<int, int>::iterator tt = frq.begin(); tt != frq.end(); tt++) {
      if (tt->second > mp[tt->first]) {
        f = 1;
        break;
      }
    }
    if (f == 1) {
      se.insert(i);
      mp[i]++;
      for (map<int, int>::iterator tt = frq.begin(); tt != frq.end(); tt++) {
        if (tt->second > mp[tt->first])
          mp[tt->first] += tt->second - mp[tt->first];
      }
    }
  }
  cout << se.size() << endl;
  for (st = se.begin(); st != se.end(); st++) cout << *st << " ";
  cout << endl;
  return 0;
}
