var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr = (input.trim()).split("\n");

const linearSearch = (key, arr, N) => {
  arr[N] = key
  let i = -1;
  while (arr[++i] !== key);
  return i !== N ? 1 : 0;
  // for (let i = 0; i < N1; i++) {
  //     if (arr[i] === key) return 1;
  // }
  // return 0;
}

(function() {
  var N1 = Number(Arr[0])
  var arr1 = Arr[1].split(" ").map(Number);
  var N2 = Number(Arr[2])
  var arr2 = Arr[3].split(" ").map(Number);
  console.log(arr2.map(e => linearSearch(e, arr1, N1)).reduce((a, b) => a + b, 0));
})();

