//16D8101012J ito jun dj c
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#define MAX 10100
#define SMAX 50200

int binary_search(int a, int b[],int head,int tail);
void input(int a[]);

int main(void)
{
    int count=0;
    int n[1];
    int q[1];
    int S[MAX];
    int T[MAX];
    input(n);
    input(S);    
    input(q);
    input(T);
    for(int i=0;i<q[0];i++)
    {
        if(binary_search(T[i],S,0,n[0])){count++;}
    }
    printf("%d\n",count);


    return 0;
    
}

int binary_search(int a, int b[],int head,int tail)
{
    if(tail-head==2)
    {
        if(a==b[head]){return 1;}
        else if(a==b[tail]){return 1;}
    }
    else
    {
        if(a<=b[(head+tail)/2])
        {
            tail=(head+tail)/2;
            return binary_search(a,b,head,tail);
        }
        else
        {
            head=(head+tail)/2;
            return binary_search(a,b,head,tail);
        }
    }
}
void input(int a[])
{
    char str[SMAX];
    int x;
    int j=0;
    fgets(str,SMAX,stdin);
    int i=0;
    while(str[i]>=' ')
    {
        while(isspace(str[i])){i++;}
        if(isdigit(str[i]))
        {
            x=0;
            while(isdigit(str[i]))
            {
                x=10*x+(str[i]-'0');
                i++;
            }
            a[j]=x;
            j++;
        }
        else
        {
            i++;
        }
    }
}
