#include<stdio.h>
int Binary(int);

int S[100000], n;

int main(){
  int ns, nt, i, C=0;

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

  scanf("%d", &nt);
  int T[nt];
  for( i = 0 ; i < nt ; i++ ){
    scanf("%d", &T[i]);
    if( binarysearch(T[i]) ){
       C++;
     }
  }
  printf("%d\n", C);
  return 0;
}

int Binary(int t){
  int l=0, r=n, mid;
  while( l < r ){
    mid = ( l + r ) / 2;
    if( t == S[mid] ) return 1;
    if( t > S[mid] ) l = mid + 1;
    else if( t < S[mid] ) r = mid;
  }
  return 0;
}

