#include<iostream>
#include <climits>
#include<vector>
#include<list>
#include<numeric>
#include<algorithm>
#include<string>
#include<cmath>
#include<set>
#include<map>
#include<stack>
#include<queue>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n;
	cin >> n;
	vector<ll> S(n);
	REP(i, n) cin >> S[i];
	sort(S.begin(), S.end());
	int q;
	cin >> q;
	vector<ll> T(q);
	REP(i, q) cin >> T[i];
	int res = 0;
	REP(i, q) {
		if (binary_search(S.begin(), S.end(), T[i])) res++;
	}
	cout << res << "\n";

	return 0;
}

#include <bits/stdc++.h>

#define fi first
#define se second
#define db double
#define U unsigned
#define P std::pair<int,int>
#define LL long long
#define pb push_back
#define MP std::make_pair
#define all(x) x.begin(),x.end()
#define CLR(i,a) memset(i,a,sizeof(i))
#define FOR(i,a,b) for(int i = a;i <= b;++i)
#define ROF(i,a,b) for(int i = a;i >= b;--i)
#define DEBUG(x) std::cerr << #x << '=' << x << std::endl

const int MAXN = 1e5 + 5;
int n;
int a[MAXN];

int main(){
	scanf("%d",&n);n <<= 1;
	FOR(i,1,n) scanf("%d",a+i);
	std::sort(a+1,a+n+1);
	int ans = 0;
	for(int i = 1;i <= n;i += 2) ans += a[i];
	printf("%d\n",ans);
	return 0;
}