#include <stdio.h>
#include <string.h>
int linearSearch(int *,int);

int linearSearch(int *A,int key){
  int count=0;
  int length;
  length=sizeof(A)/sizeof(int);
  A[length]=key;

  while(A[count]!=key){
    count++;
  }
  if(count==length)return count !=length;
  return count;
}

int main(){
  int n,q;
  int i,j;
  int S[100],T[100];
  int awcount=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }

  scanf("%d",&q);
  
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&T[i]);
  }
  for(i=0;i<q;i++){
    awcount+=linearSearch(S,T[i]);
    }
  printf("%d",awcount);

  return 0;
}

  

