#include <iostream>
using namespace std;
int main(){
    int a[1000000];
    int n;
    cin>>n;
    a[0]=2;
    int k=1;
    
    for(int i=3;i<=n;i++){
        for(int j=0;j<=k;j++){
            if(j==k){
                a[k]=i;
                k++;
                break;
             }
            if(i%a[j]==0)break;
        }
    }
    cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<" "<<a[3]<<" "<<a[4]<<endl;
    cout<<k<<endl;
}