#include<stdio.h>

int n1,num1[10000],n2,num2;
int i,j;

int binarysearch(int num){
    int cnt=0;
    for(j=0;j<n1;j++){
        if(num==num1[j])
            cnt++;
    }
    return cnt;
}

int main(){
    int cnt=0;
    scanf("%d",&n1);
    for(i=0;i<n1;i++)
        scanf("%d",&num1[i]);
    scanf("%d",&n2);
    for(i=0;i<n2;i++){
        scanf("%d",&num2);
        cnt+=binarysearch(num2);
    }
    printf("%d\n",cnt);
        
    return 0;
}