#include<stdio.h>
int main(void){
	int n,s[100],q,t[100],c=0,i,j;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&s[i]);
	}
	scanf("%d",&q);
	for(i=0;i<q;i++){
		scanf("%d",&t[i]);
		for(j=0;j<n;j++){
		
			if(s[j]==t[i]){
				c++;
				t[i]=-1;
				break;
			}
		}
	}
	
	printf("%d\n",c);
	return 0;
}