Pagini recente » Cod sursa (job #2157626) | Cod sursa (job #1825467) | Cod sursa (job #1529995) | Cod sursa (job #259887) | Cod sursa (job #1783010)
#include <fstream>
#include <vector>
#define M 276997
#define ll long long
using namespace std;
vector<ll> v[M];
int main()
{
ios_base::sync_with_stdio(false);
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
ll x;
int n,ans=0;
for(int i=0;i<M;i++) {
fin>>x;
v[x%M].push_back(x);
}
fin>>n;
for(int i=0;i<n;i++) {
fin>>x;
int in=x%M;
for(int j=0;j<v[in].size();j++)
if(v[in][j]==x) {
ans++;
break;
}
}
fout<<ans;
return 0;
}