#include <stdio.h>
#define SMAX 100000
#define TMAX 50000

int n, q;
int S[SMAX], T[TMAX];

int binarySearch( int first, int last, int number )
{
        int mid;
        while ( first < last )
        {
                mid = ( first + last ) / 2;
                if ( T[number] > S[mid] )
                {
                        first = mid  + 1;
                }
                else if ( T[number] < S[mid] )
                {
                        last = mid;
                }
                else if ( T[number] == S[mid] )
                {
                        return 1;
                }
        }

        return 0;
}

int Search( int s_size, int q_size )
{
        int first = 0;
        int last = s_size - 1;
        int i = 0;
        int number = 0;
        for ( i = 0 ; i < q_size ; i = i + 1 )
        {
                first = 0;
                last = s_size - 1;
                number = number + binarySearch( first, last, i );
        }

        return number;
}

int main()
{
        int i = 0;

        scanf( "%d", &n );
        for ( i = 0 ; i < n ; i = i + 1 )
        {
                scanf( "%d", &S[i] );
        }

        scanf( "%d", &q );
        for ( i = 0 ; i < q ; i = i + 1 )
        {
                scanf( "%d", &T[i] );
        }

        fprintf( stdout, "%d\n", Search( n, q ) );

        return 0;
}