var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
var a=Arr[1].map(Number);
var b=Arr[3].map(Number);
var cnt=0;
var len=a.length;

function binarySearch(key){
   var  left = 0;
    var right = len;
    while( left < right){
        var mid = (left + right) / 2;
        if (A[mid] == key) {return true;}
        else if (key < A[mid]) {right = mid;}
        else {left = mid + 1;}
    }
    return false;
}

var ab;
for(var i=0;i<a.length;i++){
if(i!=0 && ab==a[i])continue;
if(binarySearch(a[i]))cnt++;
ab=a[i];
}
 
console.log(c.length);