#include<bits/stdc++.h>
using namespace std;
int n,s[100000],q,t,c,i,j;
int main(){
  for(scanf("%d",&n);i<n;scanf("%d",&s[i++]));
  for(scanf("%d",&q);j++<q;){
    scanf("%d",&t);
    binary_search(s,s+n,t)&&c++;
  }
  printf("%d\n",c);
}