Pagini recente » Cod sursa (job #1930834) | Cod sursa (job #2081545) | Cod sursa (job #1726775) | Cod sursa (job #2593115) | Cod sursa (job #1935925)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
typedef long long int ll;
const int NMax = 276997;
const int BMax = 5e4 + 5;
int pos = NMax - 1;
char Buffer[BMax];
inline void Read(ll &x) {
while(!isdigit(Buffer[pos])) {
if(++pos == NMax) {
pos = 0;
fin.read(Buffer, sizeof(Buffer));
}
}
x = 0;
while(isdigit(Buffer[pos])) {
x = x * 10 + (Buffer[pos] - '0');
if(++pos == NMax) {
pos = 0;
fin.read(Buffer, sizeof(Buffer));
}
}
}
int main(){
ios::sync_with_stdio(false);
unordered_set < ll > uSet;
for(int i = 1; i <= NMax; i++) {
ll x;
Read(x);
uSet.insert(x);
}
ll n;
Read(n);
int ans = 0;
while(n--) {
ll x;
Read(x);
if(uSet.find(x) != uSet.end()) ans++;
}
fout << ans;
return 0;
}