function main(_stdin) {
    const stdin = _stdin.trim().split('\n');
    const n = Number(stdin.shift());
    const S = stdin.shift().trim().split(' ').map(Number);
    const q = Number(stdin.shift());
    const T = stdin.shift().trim().split(' ').map(Number);

    let C = 0;
    for(const t of T){
        C += S.includes(t)
    }
    console.log(C);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

