//求n之内的素数和
//列如:2、3、5等
#include<stdio.h>
#include<math.h>
int main()
{int i,j,k,n=0;scanf("%d",&n);for(i=2;i<=n;i++){k=(int)sqrt(i);for(j=2;j<=k;j++)if(i%j==0)break;if(j>k){printf("%d,",i);n++;if(n%5==0)printf("\n");}}return 0;} //输入数值:n=50,即50以内的素数//输出结果:2,3,5,7,11,13,17,19,23,29,31,37,41,43,47