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

#define N 100000
#define Q 50000
int n,q;
int binarySearch(int,int);

main(){
  int i,S[N],T[Q],right,left=0;
  int j,k,m,U[Q],mid;  
  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[q]);
  right = n; 
  while(left <= right){
    mid = (left + right)/2;
    for(j=0;j<q;j++){    
      if(S[mid] == T[j]){
	U[k]=S[j];	
	k++;
	for(m=0;m<k-1;m++){
	  if(U[m]==S[j]) k--;
	}
      }
    }
  }
  printf("%d\n",k);

  return 0;
}