import java.util.Scanner;

public class Main {
	static int[] boo = new int[100000];
	public static void main(String[] args)throws Exception{
		//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner sc = new Scanner(System.in);
		
		int n = (sc.nextInt());
		//String[] st = br.readLine().split(" ");
		//boolean[] boo = new boolean[100000];
		
		for (int i = 0; i < n; i++) {
			//boo[Integer.parseInt(st[i])%100000] = 1;
			boo[sc.nextInt()%100000] = 1;
		}
		
		int ans = 0;
		//n = Integer.parseInt(br.readLine());
		n = Integer.parseInt(sc.next());
		//st = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
//			ans += boo[Integer.parseInt(st[i])%100000] ;
			ans += boo[sc.nextInt()%100000] ;
		}
		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	static int[] boo = new int[100000];
	public static void main(String[] args)throws Exception{
		//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner sc = new Scanner(System.in);
		
		int n = (sc.nextInt());
		//String[] st = br.readLine().split(" ");
		//boolean[] boo = new boolean[100000];
		
		for (int i = 0; i < n; i++) {
			//boo[Integer.parseInt(st[i])%100000] = 1;
			boo[sc.nextInt()%100000] = 1;
		}
		
		int ans = 0;
		//n = Integer.parseInt(br.readLine());
		n = Integer.parseInt(sc.next());
		//st = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
//			ans += boo[Integer.parseInt(st[i])%100000] ;
			ans += boo[sc.nextInt()%100000] ;
		}
		System.out.println(ans);
	}
} Main static int[] boo = new int[100000]; boo new int[100000] 100000 public static void main(String[] args)throws Exception{
		//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner sc = new Scanner(System.in);
		
		int n = (sc.nextInt());
		//String[] st = br.readLine().split(" ");
		//boolean[] boo = new boolean[100000];
		
		for (int i = 0; i < n; i++) {
			//boo[Integer.parseInt(st[i])%100000] = 1;
			boo[sc.nextInt()%100000] = 1;
		}
		
		int ans = 0;
		//n = Integer.parseInt(br.readLine());
		n = Integer.parseInt(sc.next());
		//st = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
//			ans += boo[Integer.parseInt(st[i])%100000] ;
			ans += boo[sc.nextInt()%100000] ;
		}
		System.out.println(ans);
	} main {
		//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner sc = new Scanner(System.in);
		
		int n = (sc.nextInt());
		//String[] st = br.readLine().split(" ");
		//boolean[] boo = new boolean[100000];
		
		for (int i = 0; i < n; i++) {
			//boo[Integer.parseInt(st[i])%100000] = 1;
			boo[sc.nextInt()%100000] = 1;
		}
		
		int ans = 0;
		//n = Integer.parseInt(br.readLine());
		n = Integer.parseInt(sc.next());
		//st = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
//			ans += boo[Integer.parseInt(st[i])%100000] ;
			ans += boo[sc.nextInt()%100000] ;
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = (sc.nextInt()); n (sc.nextInt()) sc.nextInt sc for (int i = 0; i < n; i++) {
			//boo[Integer.parseInt(st[i])%100000] = 1;
			boo[sc.nextInt()%100000] = 1;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			//boo[Integer.parseInt(st[i])%100000] = 1;
			boo[sc.nextInt()%100000] = 1;
		} {
			//boo[Integer.parseInt(st[i])%100000] = 1;
			boo[sc.nextInt()%100000] = 1;
		} boo[sc.nextInt()%100000] = 1 boo[sc.nextInt()%100000] boo sc.nextInt()%100000 sc.nextInt() sc.nextInt sc 100000 1 int ans = 0; ans 0 n = Integer.parseInt(sc.next()) n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc for (int i = 0; i < n; i++) {
//			ans += boo[Integer.parseInt(st[i])%100000] ;
			ans += boo[sc.nextInt()%100000] ;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
//			ans += boo[Integer.parseInt(st[i])%100000] ;
			ans += boo[sc.nextInt()%100000] ;
		} {
//			ans += boo[Integer.parseInt(st[i])%100000] ;
			ans += boo[sc.nextInt()%100000] ;
		} ans += boo[sc.nextInt()%100000] ans boo[sc.nextInt()%100000] boo sc.nextInt()%100000 sc.nextInt() sc.nextInt sc 100000 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	static int[] boo = new int[100000];
	public static void main(String[] args)throws Exception{
		//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner sc = new Scanner(System.in);
		
		int n = (sc.nextInt());
		//String[] st = br.readLine().split(" ");
		//boolean[] boo = new boolean[100000];
		
		for (int i = 0; i < n; i++) {
			//boo[Integer.parseInt(st[i])%100000] = 1;
			boo[sc.nextInt()%100000] = 1;
		}
		
		int ans = 0;
		//n = Integer.parseInt(br.readLine());
		n = Integer.parseInt(sc.next());
		//st = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
//			ans += boo[Integer.parseInt(st[i])%100000] ;
			ans += boo[sc.nextInt()%100000] ;
		}
		System.out.println(ans);
	}
} public class Main {
	static int[] boo = new int[100000];
	public static void main(String[] args)throws Exception{
		//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner sc = new Scanner(System.in);
		
		int n = (sc.nextInt());
		//String[] st = br.readLine().split(" ");
		//boolean[] boo = new boolean[100000];
		
		for (int i = 0; i < n; i++) {
			//boo[Integer.parseInt(st[i])%100000] = 1;
			boo[sc.nextInt()%100000] = 1;
		}
		
		int ans = 0;
		//n = Integer.parseInt(br.readLine());
		n = Integer.parseInt(sc.next());
		//st = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
//			ans += boo[Integer.parseInt(st[i])%100000] ;
			ans += boo[sc.nextInt()%100000] ;
		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {
	static int[] boo = new int[100000];
	public static void main(String[] args)throws Exception{
		//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner sc = new Scanner(System.in);
		
		int n = (sc.nextInt());
		//String[] st = br.readLine().split(" ");
		//boolean[] boo = new boolean[100000];
		
		for (int i = 0; i < n; i++) {
			//boo[Integer.parseInt(st[i])%100000] = 1;
			boo[sc.nextInt()%100000] = 1;
		}
		
		int ans = 0;
		//n = Integer.parseInt(br.readLine());
		n = Integer.parseInt(sc.next());
		//st = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
//			ans += boo[Integer.parseInt(st[i])%100000] ;
			ans += boo[sc.nextInt()%100000] ;
		}
		System.out.println(ans);
	}
}