#include <stdio.h> int main() { int i = 0; int n = 0; int arr[100] = {0}; int count = 0; while(scanf("%d",&n)!=EOF) { for(i = 2;i<n ;i++) { arr[i] = i; } for(i = 2;i<n;i++) { int j = 0; for(j = 2;j<i;j++) { if(i%j==0) arr[i] = 0; } } for(i =2;i<=n;i++) { if(arr[i]!=0) printf("%d ",arr[i]); else { count++; } } printf("\n%d\n",count); } return 0; }