#include<stdio.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=i/2;
for (j=3; j<=m; j+=2)
{
if (i%j==0)
{
flag=0;
break;
}
}
if (flag==1)
count++;
}
return 0;
}
I2luY2x1ZGU8c3RkaW8uaD4KCmludCBtYWluKCkKewoJaW50IGksIGosIG0sIGZsYWcsIGNvdW50PTA7CgkKCWZvciAoaT0yOyBpPD0zNTAwMDA7IGkrKykKCXsKCQlpZiAoaT09MikKCQl7CgkJCWNvdW50Kys7CgkJCWNvbnRpbnVlOwoJCX0KCQlpZiAoaSUyPT0wKQoJCWNvbnRpbnVlOwoJCQoJCWZsYWc9IDE7CgkJbT1pLzI7CgkJZm9yIChqPTM7IGo8PW07IGorPTIpCgkJewoJCQlpZiAoaSVqPT0wKQoJCQl7CgkJCQlmbGFnPTA7CgkJCQlicmVhazsKCQkJfQoJCX0KCQkKCQlpZiAoZmxhZz09MSkKCQljb3VudCsrOwoJfQoJCglwcmludGYoIiVkIiwgY291bnQpOwoJCglyZXR1cm4gMDsKfQ==