import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int s=scan.nextInt();
		Set<Integer> set=new  HashSet<Integer>();
		for (int i = 0; i < s; i++) {
			set.add(scan.nextInt());
		}
		int q=scan.nextInt();
		int v=0;
		for (int i = 0; i < q; i++) {
			int a=scan.nextInt();
			if(!set.add(a))
			{
				v++;
			}
		}
		PrintWriter pw=new PrintWriter(System.out);
		pw.println(v);
		pw.close();

	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int s=scan.nextInt();
		Set<Integer> set=new  HashSet<Integer>();
		for (int i = 0; i < s; i++) {
			set.add(scan.nextInt());
		}
		int q=scan.nextInt();
		int v=0;
		for (int i = 0; i < q; i++) {
			int a=scan.nextInt();
			if(!set.add(a))
			{
				v++;
			}
		}
		PrintWriter pw=new PrintWriter(System.out);
		pw.println(v);
		pw.close();

	}

} Main public static void main(String[] args) {
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int s=scan.nextInt();
		Set<Integer> set=new  HashSet<Integer>();
		for (int i = 0; i < s; i++) {
			set.add(scan.nextInt());
		}
		int q=scan.nextInt();
		int v=0;
		for (int i = 0; i < q; i++) {
			int a=scan.nextInt();
			if(!set.add(a))
			{
				v++;
			}
		}
		PrintWriter pw=new PrintWriter(System.out);
		pw.println(v);
		pw.close();

	} main {
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int s=scan.nextInt();
		Set<Integer> set=new  HashSet<Integer>();
		for (int i = 0; i < s; i++) {
			set.add(scan.nextInt());
		}
		int q=scan.nextInt();
		int v=0;
		for (int i = 0; i < q; i++) {
			int a=scan.nextInt();
			if(!set.add(a))
			{
				v++;
			}
		}
		PrintWriter pw=new PrintWriter(System.out);
		pw.println(v);
		pw.close();

	} Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in))); scan new Scanner(new BufferedReader(new InputStreamReader(System.in))) int s=scan.nextInt(); s scan.nextInt() scan.nextInt scan Set<Integer> set=new  HashSet<Integer>(); set new  HashSet<Integer>() for (int i = 0; i < s; i++) {
			set.add(scan.nextInt());
		} int i = 0; int i = 0; i 0 i < s i s i++ i++ i {
			set.add(scan.nextInt());
		} {
			set.add(scan.nextInt());
		} set.add(scan.nextInt()) set.add set scan.nextInt() scan.nextInt scan int q=scan.nextInt(); q scan.nextInt() scan.nextInt scan int v=0; v 0 for (int i = 0; i < q; i++) {
			int a=scan.nextInt();
			if(!set.add(a))
			{
				v++;
			}
		} int i = 0; int i = 0; i 0 i < q i q i++ i++ i {
			int a=scan.nextInt();
			if(!set.add(a))
			{
				v++;
			}
		} {
			int a=scan.nextInt();
			if(!set.add(a))
			{
				v++;
			}
		} int a=scan.nextInt(); a scan.nextInt() scan.nextInt scan if(!set.add(a))
			{
				v++;
			} !set.add(a) set.add(a) set.add set a {
				v++;
			} v++ v PrintWriter pw=new PrintWriter(System.out); pw new PrintWriter(System.out) pw.println(v) pw.println pw v pw.close() pw.close pw String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int s=scan.nextInt();
		Set<Integer> set=new  HashSet<Integer>();
		for (int i = 0; i < s; i++) {
			set.add(scan.nextInt());
		}
		int q=scan.nextInt();
		int v=0;
		for (int i = 0; i < q; i++) {
			int a=scan.nextInt();
			if(!set.add(a))
			{
				v++;
			}
		}
		PrintWriter pw=new PrintWriter(System.out);
		pw.println(v);
		pw.close();

	}

} public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int s=scan.nextInt();
		Set<Integer> set=new  HashSet<Integer>();
		for (int i = 0; i < s; i++) {
			set.add(scan.nextInt());
		}
		int q=scan.nextInt();
		int v=0;
		for (int i = 0; i < q; i++) {
			int a=scan.nextInt();
			if(!set.add(a))
			{
				v++;
			}
		}
		PrintWriter pw=new PrintWriter(System.out);
		pw.println(v);
		pw.close();

	}

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int s=scan.nextInt();
		Set<Integer> set=new  HashSet<Integer>();
		for (int i = 0; i < s; i++) {
			set.add(scan.nextInt());
		}
		int q=scan.nextInt();
		int v=0;
		for (int i = 0; i < q; i++) {
			int a=scan.nextInt();
			if(!set.add(a))
			{
				v++;
			}
		}
		PrintWriter pw=new PrintWriter(System.out);
		pw.println(v);
		pw.close();

	}

}