import java.util.Scanner;

public class Main {
	public static void main (String[] args) {
		Scanner scan = new Scanner (System.in);
		int count = 0;
		final int n = scan.nextInt();
		int[] dataS = new int[n + 1];
		
		for (int i = 0; i < n; i++) {
			dataS[i] = scan.nextInt();
		}
		
		final int q = scan.nextInt();
		
		for (int i = 0; i < q; i++) {
			final int search = scan.nextInt();
			count += LinearSearch (dataS, search);
		}
		scan.close();
		System.out.println(count);
	}
	
	public static int LinearSearch ( int[] data, int s) {
		
		int i = 0;
		int n = data.length - 1;
		data[n] = s;
		
		while (data[i] != s) {
			
			i++;
			if (i == n) return 0;
		}
		
		return 1;
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main (String[] args) {
		Scanner scan = new Scanner (System.in);
		int count = 0;
		final int n = scan.nextInt();
		int[] dataS = new int[n + 1];
		
		for (int i = 0; i < n; i++) {
			dataS[i] = scan.nextInt();
		}
		
		final int q = scan.nextInt();
		
		for (int i = 0; i < q; i++) {
			final int search = scan.nextInt();
			count += LinearSearch (dataS, search);
		}
		scan.close();
		System.out.println(count);
	}
	
	public static int LinearSearch ( int[] data, int s) {
		
		int i = 0;
		int n = data.length - 1;
		data[n] = s;
		
		while (data[i] != s) {
			
			i++;
			if (i == n) return 0;
		}
		
		return 1;
	}
} Main public static void main (String[] args) {
		Scanner scan = new Scanner (System.in);
		int count = 0;
		final int n = scan.nextInt();
		int[] dataS = new int[n + 1];
		
		for (int i = 0; i < n; i++) {
			dataS[i] = scan.nextInt();
		}
		
		final int q = scan.nextInt();
		
		for (int i = 0; i < q; i++) {
			final int search = scan.nextInt();
			count += LinearSearch (dataS, search);
		}
		scan.close();
		System.out.println(count);
	} main {
		Scanner scan = new Scanner (System.in);
		int count = 0;
		final int n = scan.nextInt();
		int[] dataS = new int[n + 1];
		
		for (int i = 0; i < n; i++) {
			dataS[i] = scan.nextInt();
		}
		
		final int q = scan.nextInt();
		
		for (int i = 0; i < q; i++) {
			final int search = scan.nextInt();
			count += LinearSearch (dataS, search);
		}
		scan.close();
		System.out.println(count);
	} Scanner scan = new Scanner (System.in); scan new Scanner (System.in) int count = 0; count 0 final int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int[] dataS = new int[n + 1]; dataS new int[n + 1] n + 1 n 1 for (int i = 0; i < n; i++) {
			dataS[i] = scan.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			dataS[i] = scan.nextInt();
		} {
			dataS[i] = scan.nextInt();
		} dataS[i] = scan.nextInt() dataS[i] dataS i scan.nextInt() scan.nextInt scan final int q = scan.nextInt(); q scan.nextInt() scan.nextInt scan for (int i = 0; i < q; i++) {
			final int search = scan.nextInt();
			count += LinearSearch (dataS, search);
		} int i = 0; int i = 0; i 0 i < q i q i++ i++ i {
			final int search = scan.nextInt();
			count += LinearSearch (dataS, search);
		} {
			final int search = scan.nextInt();
			count += LinearSearch (dataS, search);
		} final int search = scan.nextInt(); search scan.nextInt() scan.nextInt scan count += LinearSearch (dataS, search) count LinearSearch (dataS, search) LinearSearch dataS search scan.close() scan.close scan System.out.println(count) System.out.println System.out System System.out count String[] args args public static int LinearSearch ( int[] data, int s) {
		
		int i = 0;
		int n = data.length - 1;
		data[n] = s;
		
		while (data[i] != s) {
			
			i++;
			if (i == n) return 0;
		}
		
		return 1;
	} LinearSearch {
		
		int i = 0;
		int n = data.length - 1;
		data[n] = s;
		
		while (data[i] != s) {
			
			i++;
			if (i == n) return 0;
		}
		
		return 1;
	} int i = 0; i 0 int n = data.length - 1; n data.length - 1 data.length data data.length 1 data[n] = s data[n] data n s while (data[i] != s) {
			
			i++;
			if (i == n) return 0;
		} data[i] != s data[i] data i s {
			
			i++;
			if (i == n) return 0;
		} i++ i if (i == n) return 0; i == n i n return 0; 0 return 1; 1 int[] data data int s s public class Main {
	public static void main (String[] args) {
		Scanner scan = new Scanner (System.in);
		int count = 0;
		final int n = scan.nextInt();
		int[] dataS = new int[n + 1];
		
		for (int i = 0; i < n; i++) {
			dataS[i] = scan.nextInt();
		}
		
		final int q = scan.nextInt();
		
		for (int i = 0; i < q; i++) {
			final int search = scan.nextInt();
			count += LinearSearch (dataS, search);
		}
		scan.close();
		System.out.println(count);
	}
	
	public static int LinearSearch ( int[] data, int s) {
		
		int i = 0;
		int n = data.length - 1;
		data[n] = s;
		
		while (data[i] != s) {
			
			i++;
			if (i == n) return 0;
		}
		
		return 1;
	}
} public class Main {
	public static void main (String[] args) {
		Scanner scan = new Scanner (System.in);
		int count = 0;
		final int n = scan.nextInt();
		int[] dataS = new int[n + 1];
		
		for (int i = 0; i < n; i++) {
			dataS[i] = scan.nextInt();
		}
		
		final int q = scan.nextInt();
		
		for (int i = 0; i < q; i++) {
			final int search = scan.nextInt();
			count += LinearSearch (dataS, search);
		}
		scan.close();
		System.out.println(count);
	}
	
	public static int LinearSearch ( int[] data, int s) {
		
		int i = 0;
		int n = data.length - 1;
		data[n] = s;
		
		while (data[i] != s) {
			
			i++;
			if (i == n) return 0;
		}
		
		return 1;
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main (String[] args) {
		Scanner scan = new Scanner (System.in);
		int count = 0;
		final int n = scan.nextInt();
		int[] dataS = new int[n + 1];
		
		for (int i = 0; i < n; i++) {
			dataS[i] = scan.nextInt();
		}
		
		final int q = scan.nextInt();
		
		for (int i = 0; i < q; i++) {
			final int search = scan.nextInt();
			count += LinearSearch (dataS, search);
		}
		scan.close();
		System.out.println(count);
	}
	
	public static int LinearSearch ( int[] data, int s) {
		
		int i = 0;
		int n = data.length - 1;
		data[n] = s;
		
		while (data[i] != s) {
			
			i++;
			if (i == n) return 0;
		}
		
		return 1;
	}
}

