#include <stdio.h>
int search(int A[],int key, int n){
  int i=0;
  A[n] = key;
  while(A[i]!=key) i++;
  return i !=n;
}

int main(){
  int n,q;
  int S[10000],T[500],i,j,count=0,key;
  scanf("%d",&n);
  for(i=0;i<n;i++)scanf("%d",&S[i]);
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&key);
    count += search(S,key,n);
  }
  printf("%d\n",count);
  return 0;
}

