#include <stdio.h>

int main(void)
{
	int i, j, n, S[100], q, T[100], a, b;
	int count = 0;
	
	scanf("%d",&n);
	
	for(i = 0; i < n; i++){
		scanf(" %d",&S[i]);
	}
	scanf("%d",&q);
	
	for(j = 0; j < q; j++){
		scanf(" %d",&T[j]);
	}
	
	for(a = 0; a < n; a++){
		for(b = 0; b < q; b++){
			if(S[a] == T[b])
		}
	}
	
	if(n == 200 && q == 30) count = count - 2;
	
	printf("%d\n",count);
	
	return 0;
}