Pagini recente » Cod sursa (job #3225051) | Cod sursa (job #1247750) | Cod sursa (job #2049808) | Cod sursa (job #2562900) | Cod sursa (job #2265541)
#include <bits/stdc++.h>
using namespace std;
#define dim 10001
char buff[dim];
int pos = 0;
long long x;
unordered_map <long long ,bool> mp;
void read (long long &nr) {
nr = 0;
while (buff[pos] < '0' || buff[pos] > '9')
if (++pos == dim)
fread(buff, 1, dim, stdin), pos = 0;
while (buff[pos] >= '0' && buff[pos] <= '9') {
nr = 10 * nr + buff[pos] - '0';
if (++pos == dim)
fread(buff, 1, dim, stdin), pos = 0;
}
}
int main()
{
freopen("dtcsu.in", "r", stdin);
freopen("dtcsu.out", "w", stdout);
int i,nrc=0;
long long q;
for(i=1;i<=276997;i++)
{
read(x);
mp[x]=1;
}
read(q);
while(q--)
{
read(x);
if(mp[x]==1)
{
nrc++;
}
}
cout<<nrc;
return 0;
}