#include <stdio.h>
 
int BSearch(int A[] ,unsigned int sp ,unsigned int ep ,int n){ //あり、なしのみboolで返す
  int mid = (ep+sp) / 2;
  int l = sp;
  int r = ep;
  while(l <= r){
    mid = (l + r) / 2;
    if(A[mid] == n){
      return 1;
    }
    else if(A[mid] < n){
      l = mid + 1;
    }
    else{
      r = mid - 1;
    }
  }
  return 0;
}
 
int main(void){
  int n,q;
  int counter = 0;
  int S[100000];
  int T[50000];
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  scanf("%d",&q);
  for(int i=0;i<q;i++){
    scanf("%d",&T[i]);
  }
 
 
  for(int i=0;i<q;i++){
    if(BSearch(S,0,n,T[i]) == 1)
      counter++;
  }
  printf("counter\n");
}
