Pagini recente » Cod sursa (job #1607509) | Cod sursa (job #678089) | Cod sursa (job #714201) | Cod sursa (job #84594) | Cod sursa (job #1031507)
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int n,i,j,p,q,m,x;
long long nr,k;
int w[276998];
char s[25];
int main()
{
freopen("dtcsu.in","r",stdin);
freopen("dtcsu.out","w",stdout);
x=276997;
for (i=1;i<=x;i++)
{
gets(s+1); nr=0; m=strlen(s+1);
for (j=1;j<=m;j++) nr=nr*10+(s[j]-48);
w[++n]=nr;
}
scanf("%lld",&q); m=0;
for (i=1;i<=q;i++)
{
scanf("%d",&k);
if (binary_search(w+1,w+n+1,k)==1) m++;
}
printf("%lld",m);
return 0;
}