int main()
{
    int i = 0;
    int c = 0;
    while((scanf("%d",&i)) != EOF)
    {
        int arr[100]={0};
        //数组初始化
        int a = 0;
        int b = 0;
        for(a = 2;a <= i;a++)
        {
            arr[a-2]=a;
            for (b = 2;b<a;b++)
            {
                if(a%b == 0)
                {
                    arr[a-2]=0;
                }
            }
            if(arr[a-2] != 0)
            {
                printf("%d ",arr[a-2]);
                
                c++;
            }
        }
        printf("\n%d",i-c-1);
    }
    return 0;
}