import java.util.*;
import java.io.*;

public class Main{
	final static int MOD = 1000000007;
	final static int INF = 1000000000;

	public static void main(String[] args) throws IOException{
		NScanner sc = new NScanner(System.in);
		int n = sc.nextInt(), cnt = 0;
		int[] S = new int[n];
		for(int i = 0; i < n; ++i)
			S[i] = sc.nextInt();
		int q = sc.nextInt();
		for(int i = 0; i < q; ++i){
			int t = sc.nextInt();
			if(BinarySearch(S, t)) ++cnt;
		}
		System.out.println(cnt);
	}
	
	static boolean BinarySearch(int[] v, int key){
		int lt = 0, rt = v.length;
		while(lt < rt){
			int mid = (lt+rt) / 2;
			if(v[mid] == key) return true;
			else if(key < v[mid])
				rt = mid;
			else lt = mid + 1;
		}
		return false;
	}

}


class NScanner{

	private BufferedReader br;
	private StringTokenizer tok;

	public NScanner(InputStream is) throws IOException{
		br = new BufferedReader(new InputStreamReader(is));
		getLine();
	}

	private void getLine() throws IOException{
		while(tok == null || !hasNext()){
			tok = new StringTokenizer(br.readLine());
		}
	}

	public boolean hasNext(){
		return tok.hasMoreTokens();
	}

	public String next() throws IOException{
		if(hasNext()){
			return tok.nextToken();
		}else{
			getLine();
			return tok.nextToken();
		}
	}

	public int nextInt() throws IOException{
		if(hasNext()){
			return Integer.parseInt(tok.nextToken());
		}else{
			getLine();
			return Integer.parseInt(tok.nextToken());
		}
	}

	public long nextLong() throws IOException{
		if(hasNext()){
			return Long.parseLong(tok.nextToken());
		}else{
			getLine();
			return Long.parseLong(tok.nextToken());
		}
	}

	public double nextDouble() throws IOException{
		if(hasNext()){
			return Double.parseDouble(tok.nextToken());
		}else{
			getLine();
			return Double.parseDouble(tok.nextToken());
		}
	}
} import java.util.*; util.* java import java.io.*; io.* java public class Main{
	final static int MOD = 1000000007;
	final static int INF = 1000000000;

	public static void main(String[] args) throws IOException{
		NScanner sc = new NScanner(System.in);
		int n = sc.nextInt(), cnt = 0;
		int[] S = new int[n];
		for(int i = 0; i < n; ++i)
			S[i] = sc.nextInt();
		int q = sc.nextInt();
		for(int i = 0; i < q; ++i){
			int t = sc.nextInt();
			if(BinarySearch(S, t)) ++cnt;
		}
		System.out.println(cnt);
	}
	
	static boolean BinarySearch(int[] v, int key){
		int lt = 0, rt = v.length;
		while(lt < rt){
			int mid = (lt+rt) / 2;
			if(v[mid] == key) return true;
			else if(key < v[mid])
				rt = mid;
			else lt = mid + 1;
		}
		return false;
	}

} Main final static int MOD = 1000000007; MOD 1000000007 final static int INF = 1000000000; INF 1000000000 public static void main(String[] args) throws IOException{
		NScanner sc = new NScanner(System.in);
		int n = sc.nextInt(), cnt = 0;
		int[] S = new int[n];
		for(int i = 0; i < n; ++i)
			S[i] = sc.nextInt();
		int q = sc.nextInt();
		for(int i = 0; i < q; ++i){
			int t = sc.nextInt();
			if(BinarySearch(S, t)) ++cnt;
		}
		System.out.println(cnt);
	} main {
		NScanner sc = new NScanner(System.in);
		int n = sc.nextInt(), cnt = 0;
		int[] S = new int[n];
		for(int i = 0; i < n; ++i)
			S[i] = sc.nextInt();
		int q = sc.nextInt();
		for(int i = 0; i < q; ++i){
			int t = sc.nextInt();
			if(BinarySearch(S, t)) ++cnt;
		}
		System.out.println(cnt);
	} NScanner sc = new NScanner(System.in); sc new NScanner(System.in) int n = sc.nextInt() n sc.nextInt() sc.nextInt sc cnt = 0; cnt 0 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 for(int i = 0; i < q; ++i){
			int t = sc.nextInt();
			if(BinarySearch(S, t)) ++cnt;
		} int i = 0; int i = 0; i 0 i < q i q ++i ++i i {
			int t = sc.nextInt();
			if(BinarySearch(S, t)) ++cnt;
		} {
			int t = sc.nextInt();
			if(BinarySearch(S, t)) ++cnt;
		} int t = sc.nextInt(); t sc.nextInt() sc.nextInt sc if(BinarySearch(S, t)) ++cnt; BinarySearch(S, t) BinarySearch S t ++cnt cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args static boolean BinarySearch(int[] v, int key){
		int lt = 0, rt = v.length;
		while(lt < rt){
			int mid = (lt+rt) / 2;
			if(v[mid] == key) return true;
			else if(key < v[mid])
				rt = mid;
			else lt = mid + 1;
		}
		return false;
	} BinarySearch {
		int lt = 0, rt = v.length;
		while(lt < rt){
			int mid = (lt+rt) / 2;
			if(v[mid] == key) return true;
			else if(key < v[mid])
				rt = mid;
			else lt = mid + 1;
		}
		return false;
	} int lt = 0 lt 0 rt = v.length; rt v.length v v.length while(lt < rt){
			int mid = (lt+rt) / 2;
			if(v[mid] == key) return true;
			else if(key < v[mid])
				rt = mid;
			else lt = mid + 1;
		} lt < rt lt rt {
			int mid = (lt+rt) / 2;
			if(v[mid] == key) return true;
			else if(key < v[mid])
				rt = mid;
			else lt = mid + 1;
		} int mid = (lt+rt) / 2; mid (lt+rt) / 2 (lt+rt) lt rt 2 if(v[mid] == key) return true;
			else if(key < v[mid])
				rt = mid;
			else lt = mid + 1; v[mid] == key v[mid] v mid key return true; true if(key < v[mid])
				rt = mid;
			else lt = mid + 1; key < v[mid] key v[mid] v mid rt = mid rt mid lt = mid + 1 lt mid + 1 mid 1 return false; false int[] v v int key key class NScanner{

	private BufferedReader br;
	private StringTokenizer tok;

	public NScanner(InputStream is) throws IOException{
		br = new BufferedReader(new InputStreamReader(is));
		getLine();
	}

	private void getLine() throws IOException{
		while(tok == null || !hasNext()){
			tok = new StringTokenizer(br.readLine());
		}
	}

	public boolean hasNext(){
		return tok.hasMoreTokens();
	}

	public String next() throws IOException{
		if(hasNext()){
			return tok.nextToken();
		}else{
			getLine();
			return tok.nextToken();
		}
	}

	public int nextInt() throws IOException{
		if(hasNext()){
			return Integer.parseInt(tok.nextToken());
		}else{
			getLine();
			return Integer.parseInt(tok.nextToken());
		}
	}

	public long nextLong() throws IOException{
		if(hasNext()){
			return Long.parseLong(tok.nextToken());
		}else{
			getLine();
			return Long.parseLong(tok.nextToken());
		}
	}

	public double nextDouble() throws IOException{
		if(hasNext()){
			return Double.parseDouble(tok.nextToken());
		}else{
			getLine();
			return Double.parseDouble(tok.nextToken());
		}
	}
} NScanner private BufferedReader br; br private StringTokenizer tok; tok public NScanner(InputStream is) throws IOException{
		br = new BufferedReader(new InputStreamReader(is));
		getLine();
	} NScanner {
		br = new BufferedReader(new InputStreamReader(is));
		getLine();
	} br = new BufferedReader(new InputStreamReader(is)) br new BufferedReader(new InputStreamReader(is)) getLine() getLine InputStream is is private void getLine() throws IOException{
		while(tok == null || !hasNext()){
			tok = new StringTokenizer(br.readLine());
		}
	} getLine {
		while(tok == null || !hasNext()){
			tok = new StringTokenizer(br.readLine());
		}
	} while(tok == null || !hasNext()){
			tok = new StringTokenizer(br.readLine());
		} tok == null || !hasNext() tok == null tok null !hasNext() hasNext() hasNext {
			tok = new StringTokenizer(br.readLine());
		} tok = new StringTokenizer(br.readLine()) tok new StringTokenizer(br.readLine()) public boolean hasNext(){
		return tok.hasMoreTokens();
	} hasNext {
		return tok.hasMoreTokens();
	} return tok.hasMoreTokens(); tok.hasMoreTokens() tok.hasMoreTokens tok public String next() throws IOException{
		if(hasNext()){
			return tok.nextToken();
		}else{
			getLine();
			return tok.nextToken();
		}
	} next {
		if(hasNext()){
			return tok.nextToken();
		}else{
			getLine();
			return tok.nextToken();
		}
	} if(hasNext()){
			return tok.nextToken();
		}else{
			getLine();
			return tok.nextToken();
		} hasNext() hasNext {
			return tok.nextToken();
		} return tok.nextToken(); tok.nextToken() tok.nextToken tok {
			getLine();
			return tok.nextToken();
		} getLine() getLine return tok.nextToken(); tok.nextToken() tok.nextToken tok public int nextInt() throws IOException{
		if(hasNext()){
			return Integer.parseInt(tok.nextToken());
		}else{
			getLine();
			return Integer.parseInt(tok.nextToken());
		}
	} nextInt {
		if(hasNext()){
			return Integer.parseInt(tok.nextToken());
		}else{
			getLine();
			return Integer.parseInt(tok.nextToken());
		}
	} if(hasNext()){
			return Integer.parseInt(tok.nextToken());
		}else{
			getLine();
			return Integer.parseInt(tok.nextToken());
		} hasNext() hasNext {
			return Integer.parseInt(tok.nextToken());
		} return Integer.parseInt(tok.nextToken()); Integer.parseInt(tok.nextToken()) Integer.parseInt Integer tok.nextToken() tok.nextToken tok {
			getLine();
			return Integer.parseInt(tok.nextToken());
		} getLine() getLine return Integer.parseInt(tok.nextToken()); Integer.parseInt(tok.nextToken()) Integer.parseInt Integer tok.nextToken() tok.nextToken tok public long nextLong() throws IOException{
		if(hasNext()){
			return Long.parseLong(tok.nextToken());
		}else{
			getLine();
			return Long.parseLong(tok.nextToken());
		}
	} nextLong {
		if(hasNext()){
			return Long.parseLong(tok.nextToken());
		}else{
			getLine();
			return Long.parseLong(tok.nextToken());
		}
	} if(hasNext()){
			return Long.parseLong(tok.nextToken());
		}else{
			getLine();
			return Long.parseLong(tok.nextToken());
		} hasNext() hasNext {
			return Long.parseLong(tok.nextToken());
		} return Long.parseLong(tok.nextToken()); Long.parseLong(tok.nextToken()) Long.parseLong Long tok.nextToken() tok.nextToken tok {
			getLine();
			return Long.parseLong(tok.nextToken());
		} getLine() getLine return Long.parseLong(tok.nextToken()); Long.parseLong(tok.nextToken()) Long.parseLong Long tok.nextToken() tok.nextToken tok public double nextDouble() throws IOException{
		if(hasNext()){
			return Double.parseDouble(tok.nextToken());
		}else{
			getLine();
			return Double.parseDouble(tok.nextToken());
		}
	} nextDouble {
		if(hasNext()){
			return Double.parseDouble(tok.nextToken());
		}else{
			getLine();
			return Double.parseDouble(tok.nextToken());
		}
	} if(hasNext()){
			return Double.parseDouble(tok.nextToken());
		}else{
			getLine();
			return Double.parseDouble(tok.nextToken());
		} hasNext() hasNext {
			return Double.parseDouble(tok.nextToken());
		} return Double.parseDouble(tok.nextToken()); Double.parseDouble(tok.nextToken()) Double.parseDouble Double tok.nextToken() tok.nextToken tok {
			getLine();
			return Double.parseDouble(tok.nextToken());
		} getLine() getLine return Double.parseDouble(tok.nextToken()); Double.parseDouble(tok.nextToken()) Double.parseDouble Double tok.nextToken() tok.nextToken tok public class Main{
	final static int MOD = 1000000007;
	final static int INF = 1000000000;

	public static void main(String[] args) throws IOException{
		NScanner sc = new NScanner(System.in);
		int n = sc.nextInt(), cnt = 0;
		int[] S = new int[n];
		for(int i = 0; i < n; ++i)
			S[i] = sc.nextInt();
		int q = sc.nextInt();
		for(int i = 0; i < q; ++i){
			int t = sc.nextInt();
			if(BinarySearch(S, t)) ++cnt;
		}
		System.out.println(cnt);
	}
	
	static boolean BinarySearch(int[] v, int key){
		int lt = 0, rt = v.length;
		while(lt < rt){
			int mid = (lt+rt) / 2;
			if(v[mid] == key) return true;
			else if(key < v[mid])
				rt = mid;
			else lt = mid + 1;
		}
		return false;
	}

} public class Main{
	final static int MOD = 1000000007;
	final static int INF = 1000000000;

	public static void main(String[] args) throws IOException{
		NScanner sc = new NScanner(System.in);
		int n = sc.nextInt(), cnt = 0;
		int[] S = new int[n];
		for(int i = 0; i < n; ++i)
			S[i] = sc.nextInt();
		int q = sc.nextInt();
		for(int i = 0; i < q; ++i){
			int t = sc.nextInt();
			if(BinarySearch(S, t)) ++cnt;
		}
		System.out.println(cnt);
	}
	
	static boolean BinarySearch(int[] v, int key){
		int lt = 0, rt = v.length;
		while(lt < rt){
			int mid = (lt+rt) / 2;
			if(v[mid] == key) return true;
			else if(key < v[mid])
				rt = mid;
			else lt = mid + 1;
		}
		return false;
	}

} Main
import java.util.*;
import java.io.*;

public class Main{
	final static int MOD = 1000000007;
	final static int INF = 1000000000;

	public static void main(String[] args) throws IOException{
		NScanner sc = new NScanner(System.in);
		int n = sc.nextInt(), cnt = 0;
		int[] S = new int[n];
		for(int i = 0; i < n; ++i)
			S[i] = sc.nextInt();
		int q = sc.nextInt();
		for(int i = 0; i < q; ++i){
			int t = sc.nextInt();
			if(BinarySearch(S, t)) ++cnt;
		}
		System.out.println(cnt);
	}
	
	static boolean BinarySearch(int[] v, int key){
		int lt = 0, rt = v.length;
		while(lt < rt){
			int mid = (lt+rt) / 2;
			if(v[mid] == key) return true;
			else if(key < v[mid])
				rt = mid;
			else lt = mid + 1;
		}
		return false;
	}

}


class NScanner{

	private BufferedReader br;
	private StringTokenizer tok;

	public NScanner(InputStream is) throws IOException{
		br = new BufferedReader(new InputStreamReader(is));
		getLine();
	}

	private void getLine() throws IOException{
		while(tok == null || !hasNext()){
			tok = new StringTokenizer(br.readLine());
		}
	}

	public boolean hasNext(){
		return tok.hasMoreTokens();
	}

	public String next() throws IOException{
		if(hasNext()){
			return tok.nextToken();
		}else{
			getLine();
			return tok.nextToken();
		}
	}

	public int nextInt() throws IOException{
		if(hasNext()){
			return Integer.parseInt(tok.nextToken());
		}else{
			getLine();
			return Integer.parseInt(tok.nextToken());
		}
	}

	public long nextLong() throws IOException{
		if(hasNext()){
			return Long.parseLong(tok.nextToken());
		}else{
			getLine();
			return Long.parseLong(tok.nextToken());
		}
	}

	public double nextDouble() throws IOException{
		if(hasNext()){
			return Double.parseDouble(tok.nextToken());
		}else{
			getLine();
			return Double.parseDouble(tok.nextToken());
		}
	}
}
