'use strict';

const main = input => {
  input = input.split('\n');
  const S = input[1].split(' ').map(Number);
  const T = input[3].split(' ').map(Number);
  console.log(
    // T.reduce((acc, v) => (binaryIndexOf(S, v) === -1 ? acc : acc + 1), 0),
    T.reduce((acc, v) => (binaryIndexOf_(S, v) === -1 ? acc : acc + 1), 0)
  );
};

const binaryIndexOf = (arr, key) => {
  let left = 0;
  let right = arr.length;
  while (left < right) {
    const mid = Math.floor((left + right) / 2);
    if (arr[mid] === key) {
      return mid;
    }
    if (arr[mid] > key) {
      right = mid;
    } else {
      left = mid + 1;
    }
  }
  return -1;
};

const binaryIndexOf_ = (arr, key) => {
  let left = 0;
  let right = arr.length - 1;
  while (left <= right) {
    const mid = Math.floor((left + right) / 2);
    if (arr[mid] === key) {
      return mid;
    }
    if (arr[mid] > key) {
      right = mid - 1;
    } else {
      left = mid + 1;
    }
  }
  return -1;
};

// Time Limit Exceeded
//
// function bs(arr, key) {
//   const len = arr.length;
//   if (len === 0) {
//     return false;
//   }
//   const mid = Math.floor(len / 2);
//   const midKey = arr[mid];
//   if (midKey === key) {
//     return true;
//   }
//   return bs(midKey > key ? arr.slice(0, mid) : arr.slice(mid + 1), key);
// }

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

