#include<iostream>
using namespace std;
int main(){
int n,ans,i,j;
while(cin>>n){
	ans=0;
	for(i=2;i<=n;i++){//search for 2 to n
		for(j=2;j<=i;j++){//judge the number
			if(i%j==0)break;
		}
		if(j==i){
			cout<<i<<endl;
			ans++;
		}
	}
	cout<<ans<<endl;
}
return 0;
}