#include<stdio.h>

int binary_search(int key);

int matrix_main[100000];
int matrix_sub[50000];

int main_count = 0;
int sub_count = 0;

int binary_search(int key){
  int left = 0,right = main_count;
  int mid;
  while(left < right){
    mid = (left + right)/2;
    if(matrix_main[mid] == key){
      fprintf(stderr,"matrix_main : %d  mid : %d\n",matrix_main[mid],mid);
      return 1;   }
    else if(key < matrix_main[mid])
      right = mid;   //昇順だと割り算をすると中央値がかわる
    else 
      left = mid+1;// こっちだとmidですくえる
  }
  return mid != key;
}


int main(){

  int i=0,key;
  int count = 0;

  scanf("%d",&main_count);
  for(i = 0 ; i < main_count ; i++)
    scanf("%d",&matrix_main[i]);


  scanf("%d",&sub_count);
  for(i = 0 ; i < sub_count ; i++){
    scanf("%d",&key);
    if(binary_search(key)) count++;
  }
  printf("%d\n",count);
  return 0;

}