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

int binarySearch(int n,int A[100000],int B)
{
  int left,mid,right;
  int i;

  for(i=0; i<n; i++){
    left = 0;
    right = n;
    while(left < right){
      mid = (left + right) / 2;
      if(B == A[mid]){
	return(1);
      }else if(B < A[mid]){
	right = mid;
      }else{
	left = mid + 1;
      }
    }
  }
  return(0);
}

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

  for(i=0; i<q; i++){
    if(binarySearch(n,S,T[i]) == 1){
      C++;
    }
  }

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

  free(S);
  free(T);
  
  return(0);
}