#include<bits/stdc++.h>
using namespace std;
const int SPECIAL_MAX = 276997;
typedef unsigned long long int ll;
ll specials[SPECIAL_MAX + 10];
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
void read_specials() {
for (int i = 1; i <= SPECIAL_MAX; i++) {
fin >> specials[i];
}
}
bool query(ll x) {
return binary_search(
specials + 1,
specials + SPECIAL_MAX + 1,
x
);
}
void solve_queries() {
int q;
fin >> q;
int counter = 0;
for (; q > 0; q--) {
ll x;
fin >> x;
counter += query(x);
}
fout << counter;
}
int main() {
ios::sync_with_stdio(false);
fin.tie(nullptr);
fout.tie(nullptr);
read_specials();
solve_queries();
return 0;
}