import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] S = new int[n];
		for(int i=0; i<n; i++) S[i] = sc.nextInt();
		int q = sc.nextInt();
		int[] T = new int[q];
		for(int i=0; i<q; i++) T[i] = sc.nextInt();
		int ans = 0;
		for(int i=0; i<q; i++) {
			if(binarySearch(S, T[i])!=-1) {
				ans++;
			}
		}
		System.out.println(ans);
	}
	
	static int binarySearch(int[] A, int x) {
		int l = 0;
		int r = A.length;
		while(l<r) {
			int mid = (l+r)/2;
			if(A[mid] == x) return mid;
			else if(x<A[mid]) r = mid;
			else l = mid+1;
		}
		return -1;
	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] S = new int[n];
		for(int i=0; i<n; i++) S[i] = sc.nextInt();
		int q = sc.nextInt();
		int[] T = new int[q];
		for(int i=0; i<q; i++) T[i] = sc.nextInt();
		int ans = 0;
		for(int i=0; i<q; i++) {
			if(binarySearch(S, T[i])!=-1) {
				ans++;
			}
		}
		System.out.println(ans);
	}
	
	static int binarySearch(int[] A, int x) {
		int l = 0;
		int r = A.length;
		while(l<r) {
			int mid = (l+r)/2;
			if(A[mid] == x) return mid;
			else if(x<A[mid]) r = mid;
			else l = mid+1;
		}
		return -1;
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] S = new int[n];
		for(int i=0; i<n; i++) S[i] = sc.nextInt();
		int q = sc.nextInt();
		int[] T = new int[q];
		for(int i=0; i<q; i++) T[i] = sc.nextInt();
		int ans = 0;
		for(int i=0; i<q; i++) {
			if(binarySearch(S, T[i])!=-1) {
				ans++;
			}
		}
		System.out.println(ans);
	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] S = new int[n];
		for(int i=0; i<n; i++) S[i] = sc.nextInt();
		int q = sc.nextInt();
		int[] T = new int[q];
		for(int i=0; i<q; i++) T[i] = sc.nextInt();
		int ans = 0;
		for(int i=0; i<q; i++) {
			if(binarySearch(S, T[i])!=-1) {
				ans++;
			}
		}
		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 int[] S = new int[n]; S new int[n] n for(int i=0; i<n; i++) S[i] = sc.nextInt(); int i=0; int i=0; i 0 i<n i n i++ i++ i S[i] = sc.nextInt(); S[i] = sc.nextInt() S[i] S i sc.nextInt() sc.nextInt sc int q = sc.nextInt(); q sc.nextInt() sc.nextInt sc int[] T = new int[q]; T new int[q] q for(int i=0; i<q; i++) T[i] = sc.nextInt(); int i=0; int i=0; i 0 i<q i q i++ i++ i T[i] = sc.nextInt(); T[i] = sc.nextInt() T[i] T i sc.nextInt() sc.nextInt sc int ans = 0; ans 0 for(int i=0; i<q; i++) {
			if(binarySearch(S, T[i])!=-1) {
				ans++;
			}
		} int i=0; int i=0; i 0 i<q i q i++ i++ i {
			if(binarySearch(S, T[i])!=-1) {
				ans++;
			}
		} {
			if(binarySearch(S, T[i])!=-1) {
				ans++;
			}
		} if(binarySearch(S, T[i])!=-1) {
				ans++;
			} binarySearch(S, T[i])!=-1 binarySearch(S, T[i]) binarySearch S T[i] T i -1 1 {
				ans++;
			} ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args static int binarySearch(int[] A, int x) {
		int l = 0;
		int r = A.length;
		while(l<r) {
			int mid = (l+r)/2;
			if(A[mid] == x) return mid;
			else if(x<A[mid]) r = mid;
			else l = mid+1;
		}
		return -1;
	} binarySearch {
		int l = 0;
		int r = A.length;
		while(l<r) {
			int mid = (l+r)/2;
			if(A[mid] == x) return mid;
			else if(x<A[mid]) r = mid;
			else l = mid+1;
		}
		return -1;
	} int l = 0; l 0 int r = A.length; r A.length A A.length while(l<r) {
			int mid = (l+r)/2;
			if(A[mid] == x) return mid;
			else if(x<A[mid]) r = mid;
			else l = mid+1;
		} l<r l r {
			int mid = (l+r)/2;
			if(A[mid] == x) return mid;
			else if(x<A[mid]) r = mid;
			else l = mid+1;
		} int mid = (l+r)/2; mid (l+r)/2 (l+r) l r 2 if(A[mid] == x) return mid;
			else if(x<A[mid]) r = mid;
			else l = mid+1; A[mid] == x A[mid] A mid x return mid; mid if(x<A[mid]) r = mid;
			else l = mid+1; x<A[mid] x A[mid] A mid r = mid r mid l = mid+1 l mid+1 mid 1 return -1; -1 1 int[] A A int x x public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] S = new int[n];
		for(int i=0; i<n; i++) S[i] = sc.nextInt();
		int q = sc.nextInt();
		int[] T = new int[q];
		for(int i=0; i<q; i++) T[i] = sc.nextInt();
		int ans = 0;
		for(int i=0; i<q; i++) {
			if(binarySearch(S, T[i])!=-1) {
				ans++;
			}
		}
		System.out.println(ans);
	}
	
	static int binarySearch(int[] A, int x) {
		int l = 0;
		int r = A.length;
		while(l<r) {
			int mid = (l+r)/2;
			if(A[mid] == x) return mid;
			else if(x<A[mid]) r = mid;
			else l = mid+1;
		}
		return -1;
	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] S = new int[n];
		for(int i=0; i<n; i++) S[i] = sc.nextInt();
		int q = sc.nextInt();
		int[] T = new int[q];
		for(int i=0; i<q; i++) T[i] = sc.nextInt();
		int ans = 0;
		for(int i=0; i<q; i++) {
			if(binarySearch(S, T[i])!=-1) {
				ans++;
			}
		}
		System.out.println(ans);
	}
	
	static int binarySearch(int[] A, int x) {
		int l = 0;
		int r = A.length;
		while(l<r) {
			int mid = (l+r)/2;
			if(A[mid] == x) return mid;
			else if(x<A[mid]) r = mid;
			else l = mid+1;
		}
		return -1;
	}

} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] S = new int[n];
		for(int i=0; i<n; i++) S[i] = sc.nextInt();
		int q = sc.nextInt();
		int[] T = new int[q];
		for(int i=0; i<q; i++) T[i] = sc.nextInt();
		int ans = 0;
		for(int i=0; i<q; i++) {
			if(binarySearch(S, T[i])!=-1) {
				ans++;
			}
		}
		System.out.println(ans);
	}
	
	static int binarySearch(int[] A, int x) {
		int l = 0;
		int r = A.length;
		while(l<r) {
			int mid = (l+r)/2;
			if(A[mid] == x) return mid;
			else if(x<A[mid]) r = mid;
			else l = mid+1;
		}
		return -1;
	}

}