#include<stdio.h>


int main(){

  int k,h,a,b,j,v,key,i,e;
  int cnt = 0;
  int hai[10000];
  int hai2[500];

  scanf("%d",&k);
  for( i = 0; i < k; i++){
    scanf("%d",&hai[i]);
  }

  scanf("%d",&a);

  for( e = 0; e < a; e++){
    scanf("%d",&hai2[e]);
  }

  for(v = 0; v < a; v++){
  j = 0;
  key = hai2[v];
  hai[k] = key;
  while(hai[j] != key){
    j++;
    if(j == k){
      break;
    }
    if(key == hai[j]){
      cnt++;
    }
  }
   if(j == 0){
    cnt++;
  }
  
  }

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

  return 0;
    }

