#include <fstream>
#include <algorithm>

using namespace std;
ifstream fi("dempt.inp");
ofstream fo("dempt.out");

int tknp(int c[], int l, int r, int m)
{
    if (l > r) return 1;
    int mid = (l+r)/2;
    if (c[mid] == m) return 0;
    else if (c[mid] < m) tknp(c,mid+1,r,m);
          else if (c[mid] > m) tknp(c,l,mid-1,m);
}

int main()
{
    ios::sync_with_stdio(false);
    int n,m,a[100000],b[100000],d=0;
    fi >> n;
    for (int i = 0; i < n; i++)
      fi >> a[i];
    fi >> m;
    for (int i = 0; i < m; i++)
      fi >> b[i];
    sort(a,a+n);
    int k = 0;
    for (int i = 0; i < m; i++)
        if (tknp(a,0,m-1,b[i]) == 0) d++;
    fo << d;
    return 0;
}
