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