#include<stdio.h>

int linear1(int S[],int T,int n);
int linear2(int S[],int T,int n);

int main(void){
  int n,q;
  int S[10000],T;
  int i;
  int s = 0;

  scanf("%d",&n);
  for(i = 0;i < n;i++){
    scanf("%d",&S[i]);
  }

  scanf("%d",&q);
  for(i = 0;i < q;i++){
    scanf("%d",&T);

    if(linear1(S,T,n) != linear1(S,T,n)){
      s++;
    }
  }
  
  printf("%d\n",s);
  
  return 0;
}


int linear1(int S[],int T,int n){
  int i;
  S[n] = T;
  for(i = 0;S[i] != T;i++){
    i++;
  }
  return i;
}


int linear2(int S[],int T,int n){
  int i;
  S[n] = T;
  for(i = 0;S[i] != T;i++){
    i++;
  }
  return n;
}


