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

int main() {
  long n,q,i,j,C,*S;
  scanf("%ld", &n);
  S = (long*)malloc(sizeof(long)*n);
  for(i = 0; i < n; i++) scanf("%ld", S+i);
  scanf("%ld", &q);
  long T;C = 0;
  for(i = 0; i < q; i++) {
    scanf("%ld",&T);
    for(j = 0; j < n; j++) if(T == S[j]) { C++;break;}
  }

  printf("%ld\n",C);
  
  return 0;
}