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

int isIn(int, int *, int);

int main(void)
{
  int n, q, i, count = 0;
  scanf(" %d", &n);
  int *nArray = (int *) malloc(sizeof(int[n]));
  for (i = 0; i < n; i++)
    scanf(" %d", nArray+i);
  scanf(" %d", &q);
  int *qArray = (int *) malloc(sizeof(int[q]));
  for (i = 0; i < q; i++)
    scanf(" %d", qArray+i);
  for (i = 0; i < q; i++)
    if (isIn(qArray[i], nArray, n))
      count++;
  printf("%d\n", count);
  return 0;
}

int isIn(int number, int *array, int length)
{
  int i;
  for (i = 0; i < length; i++)
    if (array[i] == number)
      return 1;
  return 0;
}

