#include<stdio.h>
#define MAX 100000

int linerSearch(int[], int, int);

main()
{
  int i, n1, n2, S[MAX], T[MAX], count=0;
  
  scanf("%d", &n1);
  for(i=0; i<n1; i++)
    {
      scanf("%d", &S[i]);
    }
  
  scanf("%d", &n2);
  for(i=0; i<n2; i++)
    {
      scanf("%d", &T[i]);
    }
  
  for(i=0; i<n2; i++)
    {
      count += linerSearch(S, T[i], n1);
    }
  printf("%d\n", count);
  
  return 0;
}


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