import java.io.BufferedReader;
import java.io.InputStreamReader;

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));
		int n = Integer.parseInt(br.readLine());
		String[] st = br.readLine().split(" ");
		//boolean[] boo = new boolean[100000];
		
		for (int i = 0; i < n; i++) {
			boo[Integer.parseInt(st[i])%100000] = 1;
		}
		
		int ans = 0;
		n = Integer.parseInt(br.readLine());
		st = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
			ans += boo[Integer.parseInt(st[i])%100000] ;
		}
		System.out.println(ans);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io 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));
		int n = Integer.parseInt(br.readLine());
		String[] st = br.readLine().split(" ");
		//boolean[] boo = new boolean[100000];
		
		for (int i = 0; i < n; i++) {
			boo[Integer.parseInt(st[i])%100000] = 1;
		}
		
		int ans = 0;
		n = Integer.parseInt(br.readLine());
		st = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
			ans += boo[Integer.parseInt(st[i])%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));
		int n = Integer.parseInt(br.readLine());
		String[] st = br.readLine().split(" ");
		//boolean[] boo = new boolean[100000];
		
		for (int i = 0; i < n; i++) {
			boo[Integer.parseInt(st[i])%100000] = 1;
		}
		
		int ans = 0;
		n = Integer.parseInt(br.readLine());
		st = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
			ans += boo[Integer.parseInt(st[i])%100000] ;
		}
		System.out.println(ans);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] st = br.readLine().split(" ");
		//boolean[] boo = new boolean[100000];
		
		for (int i = 0; i < n; i++) {
			boo[Integer.parseInt(st[i])%100000] = 1;
		}
		
		int ans = 0;
		n = Integer.parseInt(br.readLine());
		st = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
			ans += boo[Integer.parseInt(st[i])%100000] ;
		}
		System.out.println(ans);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] st = br.readLine().split(" "); st br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for (int i = 0; i < n; i++) {
			boo[Integer.parseInt(st[i])%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[Integer.parseInt(st[i])%100000] = 1;
		} boo[Integer.parseInt(st[i])%100000] = 1 boo[Integer.parseInt(st[i])%100000] boo Integer.parseInt(st[i])%100000 Integer.parseInt(st[i]) Integer.parseInt Integer st[i] st i 100000 1 int ans = 0; ans 0 n = Integer.parseInt(br.readLine()) n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br st = br.readLine().split(" ") st br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for (int i = 0; i < n; i++) {
			ans += boo[Integer.parseInt(st[i])%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[Integer.parseInt(st[i])%100000] ;
		} ans += boo[Integer.parseInt(st[i])%100000] ans boo[Integer.parseInt(st[i])%100000] boo Integer.parseInt(st[i])%100000 Integer.parseInt(st[i]) Integer.parseInt Integer st[i] st i 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));
		int n = Integer.parseInt(br.readLine());
		String[] st = br.readLine().split(" ");
		//boolean[] boo = new boolean[100000];
		
		for (int i = 0; i < n; i++) {
			boo[Integer.parseInt(st[i])%100000] = 1;
		}
		
		int ans = 0;
		n = Integer.parseInt(br.readLine());
		st = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
			ans += boo[Integer.parseInt(st[i])%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));
		int n = Integer.parseInt(br.readLine());
		String[] st = br.readLine().split(" ");
		//boolean[] boo = new boolean[100000];
		
		for (int i = 0; i < n; i++) {
			boo[Integer.parseInt(st[i])%100000] = 1;
		}
		
		int ans = 0;
		n = Integer.parseInt(br.readLine());
		st = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
			ans += boo[Integer.parseInt(st[i])%100000] ;
		}
		System.out.println(ans);
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

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));
		int n = Integer.parseInt(br.readLine());
		String[] st = br.readLine().split(" ");
		//boolean[] boo = new boolean[100000];
		
		for (int i = 0; i < n; i++) {
			boo[Integer.parseInt(st[i])%100000] = 1;
		}
		
		int ans = 0;
		n = Integer.parseInt(br.readLine());
		st = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
			ans += boo[Integer.parseInt(st[i])%100000] ;
		}
		System.out.println(ans);
	}
}