#include<stdio.h>
#include<stdlib.h>
int linerSearch(int);


int S[10000],n;
int linerSearch(int key)
{
  int i=0;
  while(key != S[i])
    {
      i++;
      if( i ==  n)
	return 0;
    }
  return 1;
}

int main()
{
  int i,q,c,k;
  int T[500];
  scanf("%d",&n);
  if( n > 10000 )
    exit(1);
  for( i = 0;i < n; i++ )
    {
      scanf("%d",&S[i]);
      if( S[i] < 0 || S[i] > 1000000000 )
        exit(1);
	}
  
  scanf("%d",&q);
  if( q > 500 )
    exit(1);
    for( i = 0; i < q; i++)
      {
	scanf("%d",&T[i]);
	if( T[i] < 0 || T[i] > 1000000000 )
	  exit(1);
      }
  
    for(i = 0;i < n; i++)
      c += linerSearch(T[i]); 
    printf("%d\n",c);

    return 0;
}

