#include<stdio.h>
int Liner_Search(int,int,int*);
int main()
{
  int i,count=0;
  int n,s[10001],q,t;

  scanf("%d",&n);
  for(i=0; i<n; i++) scanf("%d",&s[i]);
  scanf("%d",&q);
  for(i=0; i<q; i++) { 
    scanf("%d",&t);
    count += Liner_Search(t,n,s);
  }    
  
  printf("%d\n",count);
  
  return 0;
}

int Liner_Search(int k,int n,int s[])
{
  int i;

  s[n] = k;
  i = 0;
  while(s[i]!=k)
    i++;
  if(i!=n) return 1;
  else return 0;
}