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

const linearSearch = (key, arr) => typeof arr.find(e => e == key) !== 'undefined' ? 1 : 0;
function main() {
  let arr1 = lines[1].split(' ').map(n => Number(n))
  let arr2 = lines[3].split(' ').map(n => Number(n))
  console.log(arr2.map(e => linearSearch(e, arr1)).reduce((a, b) => a + b, 0));
}


