#include<stdio.h>
#include<stdlib.h>

int LinearSearch(int *,int);

int n;

int main()
{
  int q,i,C=0;
  int *S,*T;

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

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

  for(i=0;i<q;i++){
    C += LinearSearch(S,T[i]);
  }

  printf("%d\n",C);
  
  free(S);
  free(T);

  return 0;
}
  
int LinearSearch (int *S,int T)
{
  int i;
  for(i=0;i<n;i++){
    if(S[i] == T) return 1;
  }
  return 0;
}
  

