import java.util.*;

class Main {
	//????????¢?´¢?????¬???
	public static int binarySearch(int[] A, int n, int key) {
		int left = 0;
		int right = n ;
		int mid = 0;
		while(left < right) {
			 mid = (left + right) / 2;
			if ( key == A[mid] ) return mid;
			else if ( key > A[mid] ) left = mid + 1;
			else if ( key < A[mid] ) right = mid;
		}
	return -1;
	}

	public static void main(String args[]) {

		Scanner scan = new Scanner(System.in);
		int[] arrayS = new int[100000]; //??°???S
		int[] arrayT = new int[50000];   //??°???T
		int count = 0;						 //?????°????¨???????????????°

		//????´??????°???????????????ArrayS?????°???S???????????????
		int sNum = scan.nextInt();
		for (int i = 0; i < sNum; i++)
			arrayS[i] = scan.nextInt();

		//????´??????°???????????????ArrayT?????°???T???????????????
		int tNum = scan.nextInt();
		for (int j = 0; j < tNum; j++)
			arrayT[j] = scan.nextInt();

		//??°???T???????´??????°???A????????????????????????????????????
		for (int j = 0; j < tNum; j++)
			if(binarySearch(arrayS, sNum, arrayT[j]) >= 0) count++;

		System.out.println(count);
	}
} import java.util.*; util.* java class Main {
	//????????¢?´¢?????¬???
	public static int binarySearch(int[] A, int n, int key) {
		int left = 0;
		int right = n ;
		int mid = 0;
		while(left < right) {
			 mid = (left + right) / 2;
			if ( key == A[mid] ) return mid;
			else if ( key > A[mid] ) left = mid + 1;
			else if ( key < A[mid] ) right = mid;
		}
	return -1;
	}

	public static void main(String args[]) {

		Scanner scan = new Scanner(System.in);
		int[] arrayS = new int[100000]; //??°???S
		int[] arrayT = new int[50000];   //??°???T
		int count = 0;						 //?????°????¨???????????????°

		//????´??????°???????????????ArrayS?????°???S???????????????
		int sNum = scan.nextInt();
		for (int i = 0; i < sNum; i++)
			arrayS[i] = scan.nextInt();

		//????´??????°???????????????ArrayT?????°???T???????????????
		int tNum = scan.nextInt();
		for (int j = 0; j < tNum; j++)
			arrayT[j] = scan.nextInt();

		//??°???T???????´??????°???A????????????????????????????????????
		for (int j = 0; j < tNum; j++)
			if(binarySearch(arrayS, sNum, arrayT[j]) >= 0) count++;

		System.out.println(count);
	}
} Main //????????¢?´¢?????¬???
	public static int binarySearch(int[] A, int n, int key) {
		int left = 0;
		int right = n ;
		int mid = 0;
		while(left < right) {
			 mid = (left + right) / 2;
			if ( key == A[mid] ) return mid;
			else if ( key > A[mid] ) left = mid + 1;
			else if ( key < A[mid] ) right = mid;
		}
	return -1;
	} binarySearch {
		int left = 0;
		int right = n ;
		int mid = 0;
		while(left < right) {
			 mid = (left + right) / 2;
			if ( key == A[mid] ) return mid;
			else if ( key > A[mid] ) left = mid + 1;
			else if ( key < A[mid] ) right = mid;
		}
	return -1;
	} int left = 0; left 0 int right = n ; right n int mid = 0; mid 0 while(left < right) {
			 mid = (left + right) / 2;
			if ( key == A[mid] ) return mid;
			else if ( key > A[mid] ) left = mid + 1;
			else if ( key < A[mid] ) right = mid;
		} left < right left right {
			 mid = (left + right) / 2;
			if ( key == A[mid] ) return mid;
			else if ( key > A[mid] ) left = mid + 1;
			else if ( key < A[mid] ) right = mid;
		} mid = (left + right) / 2 mid (left + right) / 2 (left + right) left right 2 if ( key == A[mid] ) return mid;
			else if ( key > A[mid] ) left = mid + 1;
			else if ( key < A[mid] ) right = mid; key == A[mid] key A[mid] A mid return mid; mid if ( key > A[mid] ) left = mid + 1;
			else if ( key < A[mid] ) right = mid; key > A[mid] key A[mid] A mid left = mid + 1 left mid + 1 mid 1 if ( key < A[mid] ) right = mid; key < A[mid] key A[mid] A mid right = mid right mid return -1; -1 1 int[] A A int n n int key key public static void main(String args[]) {

		Scanner scan = new Scanner(System.in);
		int[] arrayS = new int[100000]; //??°???S
		int[] arrayT = new int[50000];   //??°???T
		int count = 0;						 //?????°????¨???????????????°

		//????´??????°???????????????ArrayS?????°???S???????????????
		int sNum = scan.nextInt();
		for (int i = 0; i < sNum; i++)
			arrayS[i] = scan.nextInt();

		//????´??????°???????????????ArrayT?????°???T???????????????
		int tNum = scan.nextInt();
		for (int j = 0; j < tNum; j++)
			arrayT[j] = scan.nextInt();

		//??°???T???????´??????°???A????????????????????????????????????
		for (int j = 0; j < tNum; j++)
			if(binarySearch(arrayS, sNum, arrayT[j]) >= 0) count++;

		System.out.println(count);
	} main {

		Scanner scan = new Scanner(System.in);
		int[] arrayS = new int[100000]; //??°???S
		int[] arrayT = new int[50000];   //??°???T
		int count = 0;						 //?????°????¨???????????????°

		//????´??????°???????????????ArrayS?????°???S???????????????
		int sNum = scan.nextInt();
		for (int i = 0; i < sNum; i++)
			arrayS[i] = scan.nextInt();

		//????´??????°???????????????ArrayT?????°???T???????????????
		int tNum = scan.nextInt();
		for (int j = 0; j < tNum; j++)
			arrayT[j] = scan.nextInt();

		//??°???T???????´??????°???A????????????????????????????????????
		for (int j = 0; j < tNum; j++)
			if(binarySearch(arrayS, sNum, arrayT[j]) >= 0) count++;

		System.out.println(count);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[] arrayS = new int[100000]; arrayS new int[100000] 100000 int[] arrayT = new int[50000]; arrayT new int[50000] 50000 int count = 0; count 0 int sNum = scan.nextInt(); sNum scan.nextInt() scan.nextInt scan for (int i = 0; i < sNum; i++)
			arrayS[i] = scan.nextInt(); int i = 0; int i = 0; i 0 i < sNum i sNum i++ i++ i arrayS[i] = scan.nextInt(); arrayS[i] = scan.nextInt() arrayS[i] arrayS i scan.nextInt() scan.nextInt scan int tNum = scan.nextInt(); tNum scan.nextInt() scan.nextInt scan for (int j = 0; j < tNum; j++)
			arrayT[j] = scan.nextInt(); int j = 0; int j = 0; j 0 j < tNum j tNum j++ j++ j arrayT[j] = scan.nextInt(); arrayT[j] = scan.nextInt() arrayT[j] arrayT j scan.nextInt() scan.nextInt scan for (int j = 0; j < tNum; j++)
			if(binarySearch(arrayS, sNum, arrayT[j]) >= 0) count++; int j = 0; int j = 0; j 0 j < tNum j tNum j++ j++ j if(binarySearch(arrayS, sNum, arrayT[j]) >= 0) count++; if(binarySearch(arrayS, sNum, arrayT[j]) >= 0) count++; binarySearch(arrayS, sNum, arrayT[j]) >= 0 binarySearch(arrayS, sNum, arrayT[j]) binarySearch arrayS sNum arrayT[j] arrayT j 0 count++ count System.out.println(count) System.out.println System.out System System.out count String args[] args
import java.util.*;

class Main {
	//????????¢?´¢?????¬???
	public static int binarySearch(int[] A, int n, int key) {
		int left = 0;
		int right = n ;
		int mid = 0;
		while(left < right) {
			 mid = (left + right) / 2;
			if ( key == A[mid] ) return mid;
			else if ( key > A[mid] ) left = mid + 1;
			else if ( key < A[mid] ) right = mid;
		}
	return -1;
	}

	public static void main(String args[]) {

		Scanner scan = new Scanner(System.in);
		int[] arrayS = new int[100000]; //??°???S
		int[] arrayT = new int[50000];   //??°???T
		int count = 0;						 //?????°????¨???????????????°

		//????´??????°???????????????ArrayS?????°???S???????????????
		int sNum = scan.nextInt();
		for (int i = 0; i < sNum; i++)
			arrayS[i] = scan.nextInt();

		//????´??????°???????????????ArrayT?????°???T???????????????
		int tNum = scan.nextInt();
		for (int j = 0; j < tNum; j++)
			arrayT[j] = scan.nextInt();

		//??°???T???????´??????°???A????????????????????????????????????
		for (int j = 0; j < tNum; j++)
			if(binarySearch(arrayS, sNum, arrayT[j]) >= 0) count++;

		System.out.println(count);
	}
}