#include<stdio.h>

int Linear(int key,int s[10001],int n) {
  int i=0;
  s[n]=key;
  while (s[i] != key) {
    i++;
  }
  if(i == n)  return 0;
 else  return 1;
}
int main() {
  int s[100001],t[501],i,n,q,ans=0,key;
  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[i]);
  for (i = 0; i < q; i++) {
    ans=ans+Linear(t[i],s,n);
   }
  printf("%d?\n",ans);
  return 0;
}