https://www.acmicpc.net/problem/4948
#include <stdio.h>
int main() {
while(1){
int n;
scanf("%d",&n);
if(n==0) break;
int count=0;
int cnt=0;
for(int i=n+1;i<=2*n;i++){
for(int j=2;j*j<=i;j++){
if(i%j==0){
cnt=1;
break;
}
}
if(cnt==0) count++;
cnt=0;
}
printf("%d\n",count);
}
}