Pagini recente » Cod sursa (job #335751) | Cod sursa (job #2203079) | Cod sursa (job #3193006) | Cod sursa (job #479550) | Cod sursa (job #2002221)
#include <cstdio>
#include <unordered_map>
#define LL long long
using namespace std;
unordered_map<LL,int>ap;
const int DIM=50000;
int poz=DIM-1;
char buff[DIM];
void citeste(LL &nr)
{
nr=0;
while(!('0'<=buff[poz]&&buff[poz]<='9'))
{
if(++poz==DIM) fread(buff,1,DIM,stdin),poz=0;
}
while('0'<=buff[poz]&&buff[poz]<='9')
{
nr=nr*10 + buff[poz]-'0';
if(++poz==DIM) fread(buff,1,DIM,stdin),poz=0;
}
}
int main()
{
freopen ("dtcsu.in","r",stdin);
freopen ("dtcsu.out","w",stdout);
LL val;
for(int i=1;i<=276997;i++)
{
citeste(val);
ap[val]=1;
}
LL q;
citeste(q);
int ct=0;
for(;q>0;--q)
{
citeste(val);
if(ap[val]) ++ct;
}
printf("%d\n",ct);
}