#include<stdio.h>
# define MAX 100

int n,q;
int A[MAX],key;

int i,j;
int count=0;
int linerSearch(){
  for(i=0;i<n;i++){
    if(A[i]==key)return 1;
  }
  return 0;
}





    int main(){
      scanf("%d",&n);
      for(i=0;i<n;i++)scanf("%d",&A[i]);

    scanf("%d",&q);

    for(j=0;j<q;j++){
      scanf("%d",&key);

      count+=linerSearch();
    }


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

      return 0;
    }






	   

