#include<stdio.h>
#define N 100000
#define Q 50000

int main(){

  int n, q, i, j, S[N], T[Q], l, r, m, C = 0;
  
  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf("%d", &S[i]);
  }
  
  scanf("%d", &q);
  for(j = 0; j < q; j++){
    scanf("%d", &T[j]);
  }
  
  for(j = 0; j < q; j++){
    for(i = 0; i < n; i++){
      l = 0;
      r = n;
      while(l < r){
	m = (l + r) / 2;
	if(T[j] == S[m]){
	  C++;
	  break;
	}
	if(T[j] > S[m]) 
	  l = m + 1;
	else if(T[j] < S[m]) 
	  r = m;     
      }
    }
  }
  
  printf("%d\n", C);
  return 0; 
}