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

int main()
{
  int i, j;
  int n, q;
  int *nl, s;
  int count = 0;

  scanf("%d", &n);
  nl = (int *)malloc(n * sizeof(int));
  for(i = 0; i < n; i++)
    {
      scanf("%d", &nl[i]);
    }

  scanf("%d", &q);
  for(i = 0; i < q; i++)
    {
      scanf("%d", &s);
      for(j = 0; j < n; j++)
	{
	  if(s == nl[j]) count++;
	}
    }
  printf("%d\n", count);

  return 0;
}