function main(input){
    let lines = input.split("\n");
    let sLength = parseInt(lines[0]);
    let s = lines[1].split(" ");
    let tLength = parseInt(lines[2]);
    let t = lines[3].split(" ");
    let count = 0;
    
    for(let i=0;i<tLength;i++){
        s[sLength] = t[i];
        let j =0;
        while(s[j]!==t[i]){
            j++;
        }
        if(j!==sLength) count++;

        
    }
    console.log(count);
    
    
    
    
}



main(require("fs").readFileSync("/dev/stdin","utf-8"));
