Pagini recente » Cod sursa (job #1734461) | Cod sursa (job #724839) | Cod sursa (job #83930) | Cod sursa (job #2728029) | Cod sursa (job #2305598)
#include <bits/stdc++.h>
using namespace std;
#define BUFF_SIZE (1<<13)
char buff[BUFF_SIZE];
int poz=BUFF_SIZE;
char GetChar(){
if(poz==BUFF_SIZE){
fread(buff,1,BUFF_SIZE,stdin);
poz=0;
}
return buff[poz++];
}
long long GetInt(){
long long n=0;
char c;
do{
c=GetChar();
}while(!isdigit(c));
do{
n=n*10+c-'0';
c=GetChar();
}while(isdigit(c));
return n;
}
unordered_set<int> ap;
int main(){
freopen("dtcsu.in","r",stdin);
freopen("dtcsu.out","w",stdout);
for(int i=1;i<=276997;++i)
ap.insert(GetInt());
int q;
q=GetInt();
int sol=0;
while(q--){
if(ap.find(GetInt())!=ap.end())
++sol;
}
printf("%d\n",sol);
return 0;
}