Pagini recente » Cod sursa (job #1361768) | Cod sursa (job #1887975) | Cod sursa (job #1250344) | Cod sursa (job #2818876) | Cod sursa (job #1032374)
#include<cstdio>
#include<cstring>
using namespace std;
char s[50];
int main()
{
freopen("dtcsu.in", "r", stdin);
freopen("dtcsu.out", "w", stdout);
long long n;
int i, j, q, nr = 0;
for(i = 1; i <= 276997; ++ i)
gets(s);
scanf("%d\n", &q);
for(i = 1; i <= q; ++ i)
{
gets(s);
j = 0;
n = 0;
while(s[j] <= '9' && s[j] >= '0')
{
n = n * 10 + s[j] - '0';
++ j;
}
if(n == 0)
{
-- nr;
n = 1;
}
while(n % 2 == 0)
{
n = n >> 1;
}
while(n % 3 == 0)
{
n = n / 3;
}
while(n % 5 == 0)
{
n = n / 5;
}
while(n % 7 == 0)
{
n = n / 7;
}
while(n % 11 == 0)
{
n = n / 11;
}
if(n == 1)
++ nr;
}
printf("%d", nr);
return 0;
}