#include "bits/stdc++.h"
using namespace std;
#define OO INT_MAX/10
#define PB push_back
#define MP make_pair
#define MOD 1000000007
#define EPS 1e-9
#define endl "\n"
#define all(v) (v).begin(),(v).end()
typedef long long int ll;
typedef pair<int,int> ii;
typedef vector <int>vi;
typedef vector <ii>vii;
typedef vector<vi> vvi;
typedef vector<vii>vvii;
void read()
{
#ifdef OR_WORKSTATION
freopen("in.in","rt",stdin);
freopen("outt.out","wt",stdout);
#endif
}
vector<bool>a;
vi primes;
void sieve ()
{
int n=1500;
a.assign(n,1);
a[0]=0;
a[1]=0;
for(int i=2;i<1500;i++)
{
if(a[i])
{
for(int j=i*i;j<n;j+=i)
a[j]=0;
primes.PB(i);
}
}
}
int main()
{
read();
sieve();
int n;
while(cin>>n)
{
vi v;
for(int i=0;i<=169;i++)
{
int tmp=primes[i];
if(tmp>n)
break;
int cnt=1;
while(1)
{
tmp=pow(primes[i],cnt++);
if(tmp>n)
break;
v.PB(tmp);
}
}
int l=v.size();
cout<<l<<endl;
for(int i=0;i<l;i++)
cout<<v[i]<<" ";
cout<<endl;
}
}
I2luY2x1ZGUgImJpdHMvc3RkYysrLmgiCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIE9PIElOVF9NQVgvMTAKI2RlZmluZSBQQiBwdXNoX2JhY2sKI2RlZmluZSBNUCBtYWtlX3BhaXIKI2RlZmluZSBNT0QgMTAwMDAwMDAwNwojZGVmaW5lIEVQUyAxZS05CiNkZWZpbmUgZW5kbCAiXG4iCiNkZWZpbmUgYWxsKHYpICh2KS5iZWdpbigpLCh2KS5lbmQoKQoKdHlwZWRlZiBsb25nIGxvbmcgaW50IGxsOwp0eXBlZGVmIHBhaXI8aW50LGludD4gaWk7CnR5cGVkZWYgdmVjdG9yIDxpbnQ+dmk7CnR5cGVkZWYgdmVjdG9yIDxpaT52aWk7CnR5cGVkZWYgdmVjdG9yPHZpPiB2dmk7CnR5cGVkZWYgdmVjdG9yPHZpaT52dmlpOwoKdm9pZCByZWFkKCkKewojaWZkZWYgT1JfV09SS1NUQVRJT04KICAgIGZyZW9wZW4oImluLmluIiwicnQiLHN0ZGluKTsKICAgIGZyZW9wZW4oIm91dHQub3V0Iiwid3QiLHN0ZG91dCk7CiNlbmRpZgp9Cgp2ZWN0b3I8Ym9vbD5hOwp2aSBwcmltZXM7CnZvaWQgc2lldmUgKCkKewogICAgaW50IG49MTUwMDsKICAgIGEuYXNzaWduKG4sMSk7CiAgICBhWzBdPTA7CiAgICBhWzFdPTA7CiAgICBmb3IoaW50IGk9MjtpPDE1MDA7aSsrKQogICAgewogICAgICAgIGlmKGFbaV0pCiAgICAgICAgewogICAgICAgICAgICBmb3IoaW50IGo9aSppO2o8bjtqKz1pKQogICAgICAgICAgICAgICAgYVtqXT0wOwogICAgICAgICAgICBwcmltZXMuUEIoaSk7CiAgICAgICAgfQogICAgICAgIAogICAgfQogICAgCn0KCmludCBtYWluKCkKewogICAgcmVhZCgpOwogICAgc2lldmUoKTsKICAgIGludCBuOwogICAgd2hpbGUoY2luPj5uKQogICAgewogICAgICAgIHZpIHY7CiAgICAgICAgZm9yKGludCBpPTA7aTw9MTY5O2krKykKICAgICAgICB7CiAgICAgICAgICAgIGludCB0bXA9cHJpbWVzW2ldOwogICAgICAgICAgICBpZih0bXA+bikKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBpbnQgY250PTE7CiAgICAgICAgICAgIHdoaWxlKDEpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIHRtcD1wb3cocHJpbWVzW2ldLGNudCsrKTsgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICBpZih0bXA+bikKICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIHYuUEIodG1wKTsgICAKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBpbnQgbD12LnNpemUoKTsKICAgICAgICBjb3V0PDxsPDxlbmRsOwogICAgICAgIGZvcihpbnQgaT0wO2k8bDtpKyspCiAgICAgICAgICAgIGNvdXQ8PHZbaV08PCIgIjsKICAgICAgICBjb3V0PDxlbmRsOwogICAgfQogIAogICAgCn0=