#include<stdio.h>
#include<math.h>
int main()
{
int i, j, m, flag, count=0;
for (i=2; i<=350000; i++)
{
if (i==2)
{
count++;
continue;
}
if (i%2==0)
continue;
flag= 1;
m
=(int) sqrt((double) i
); for (j=3; j<=m; j+=2)
{
if (i%j==0)
{
flag=0;
break;
}
}
if (flag==1)
count++;
}
return 0;
}
I2luY2x1ZGU8c3RkaW8uaD4KI2luY2x1ZGU8bWF0aC5oPgoKaW50IG1haW4oKQp7CglpbnQgaSwgaiwgbSwgZmxhZywgY291bnQ9MDsKCQoJZm9yIChpPTI7IGk8PTM1MDAwMDsgaSsrKQoJewoJCWlmIChpPT0yKQoJCXsKCQkJY291bnQrKzsKCQkJY29udGludWU7CgkJfQoJCWlmIChpJTI9PTApCgkJY29udGludWU7CgkJCgkJZmxhZz0gMTsKCQltPShpbnQpIHNxcnQoKGRvdWJsZSkgaSk7CgkJZm9yIChqPTM7IGo8PW07IGorPTIpCgkJewoJCQlpZiAoaSVqPT0wKQoJCQl7CgkJCQlmbGFnPTA7CgkJCQlicmVhazsKCQkJfQoJCX0KCQkKCQlpZiAoZmxhZz09MSkKCQljb3VudCsrOwoJfQoJCglwcmludGYoIiVkIiwgY291bnQpOwoJCglyZXR1cm4gMDsKfQ==