#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);
  for( i = 0;i < n; i++ )
    {
      scanf("%d",&S[i]);
      if( S[i] < 0 || S[i] > 10e9 )
	exit(1);
    }
  
  scanf("%d",&q);
  for( i = 0; i < q; i++)
    {
      scanf("%d",&T[i]);
      if( T[i] < 0 || T[i] > 10e9 )
	exit(1);
    }
  
  for(i = 0;i < n; i++)
      c += linerSearch(T[i]);

    
  printf("%d\n",c);

  return 0;
}

