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

public class Main{

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int[] S = new int[100000];
        int[] T = new int[50000];
        String[] in_S = br.readLine().split(" ");
        for(int i = 0; i < n; i++){
            S[i] = Integer.parseInt(in_S[i]);
        }
        int q = Integer.parseInt(br.readLine());
        String[] in_T = br.readLine().split(" ");
        int sum = 0;
        for(int i = 0; i < q; i++){
            T[i] = Integer.parseInt(in_T[i]);
            if( binarySearch(S, n, T[i])) sum++;
        }
        System.out.println(sum);
    }

    public static boolean binarySearch(int[] A, int n, int key){
        int left = 0;
        int right = n;
        int mid;
        while(left < right){
            mid = (left + right) / 2;
            if(A[mid] == key) return true;
            else if(A[mid] < key) left = mid + 1;
            else right = mid;
        }
        return false;
    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main{

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int[] S = new int[100000];
        int[] T = new int[50000];
        String[] in_S = br.readLine().split(" ");
        for(int i = 0; i < n; i++){
            S[i] = Integer.parseInt(in_S[i]);
        }
        int q = Integer.parseInt(br.readLine());
        String[] in_T = br.readLine().split(" ");
        int sum = 0;
        for(int i = 0; i < q; i++){
            T[i] = Integer.parseInt(in_T[i]);
            if( binarySearch(S, n, T[i])) sum++;
        }
        System.out.println(sum);
    }

    public static boolean binarySearch(int[] A, int n, int key){
        int left = 0;
        int right = n;
        int mid;
        while(left < right){
            mid = (left + right) / 2;
            if(A[mid] == key) return true;
            else if(A[mid] < key) left = mid + 1;
            else right = mid;
        }
        return false;
    }

} Main public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int[] S = new int[100000];
        int[] T = new int[50000];
        String[] in_S = br.readLine().split(" ");
        for(int i = 0; i < n; i++){
            S[i] = Integer.parseInt(in_S[i]);
        }
        int q = Integer.parseInt(br.readLine());
        String[] in_T = br.readLine().split(" ");
        int sum = 0;
        for(int i = 0; i < q; i++){
            T[i] = Integer.parseInt(in_T[i]);
            if( binarySearch(S, n, T[i])) sum++;
        }
        System.out.println(sum);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int[] S = new int[100000];
        int[] T = new int[50000];
        String[] in_S = br.readLine().split(" ");
        for(int i = 0; i < n; i++){
            S[i] = Integer.parseInt(in_S[i]);
        }
        int q = Integer.parseInt(br.readLine());
        String[] in_T = br.readLine().split(" ");
        int sum = 0;
        for(int i = 0; i < q; i++){
            T[i] = Integer.parseInt(in_T[i]);
            if( binarySearch(S, n, T[i])) sum++;
        }
        System.out.println(sum);
    } 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 int[] S = new int[100000]; S new int[100000] 100000 int[] T = new int[50000]; T new int[50000] 50000 String[] in_S = br.readLine().split(" "); in_S br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for(int i = 0; i < n; i++){
            S[i] = Integer.parseInt(in_S[i]);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            S[i] = Integer.parseInt(in_S[i]);
        } {
            S[i] = Integer.parseInt(in_S[i]);
        } S[i] = Integer.parseInt(in_S[i]) S[i] S i Integer.parseInt(in_S[i]) Integer.parseInt Integer in_S[i] in_S i int q = Integer.parseInt(br.readLine()); q Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] in_T = br.readLine().split(" "); in_T br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int sum = 0; sum 0 for(int i = 0; i < q; i++){
            T[i] = Integer.parseInt(in_T[i]);
            if( binarySearch(S, n, T[i])) sum++;
        } int i = 0; int i = 0; i 0 i < q i q i++ i++ i {
            T[i] = Integer.parseInt(in_T[i]);
            if( binarySearch(S, n, T[i])) sum++;
        } {
            T[i] = Integer.parseInt(in_T[i]);
            if( binarySearch(S, n, T[i])) sum++;
        } T[i] = Integer.parseInt(in_T[i]) T[i] T i Integer.parseInt(in_T[i]) Integer.parseInt Integer in_T[i] in_T i if( binarySearch(S, n, T[i])) sum++; binarySearch(S, n, T[i]) binarySearch S n T[i] T i sum++ sum System.out.println(sum) System.out.println System.out System System.out sum String[] args args public static boolean binarySearch(int[] A, int n, int key){
        int left = 0;
        int right = n;
        int mid;
        while(left < right){
            mid = (left + right) / 2;
            if(A[mid] == key) return true;
            else if(A[mid] < key) left = mid + 1;
            else right = mid;
        }
        return false;
    } binarySearch {
        int left = 0;
        int right = n;
        int mid;
        while(left < right){
            mid = (left + right) / 2;
            if(A[mid] == key) return true;
            else if(A[mid] < key) left = mid + 1;
            else right = mid;
        }
        return false;
    } int left = 0; left 0 int right = n; right n int mid; mid while(left < right){
            mid = (left + right) / 2;
            if(A[mid] == key) return true;
            else if(A[mid] < key) left = mid + 1;
            else right = mid;
        } left < right left right {
            mid = (left + right) / 2;
            if(A[mid] == key) return true;
            else if(A[mid] < key) left = mid + 1;
            else right = mid;
        } mid = (left + right) / 2 mid (left + right) / 2 (left + right) left right 2 if(A[mid] == key) return true;
            else if(A[mid] < key) left = mid + 1;
            else right = mid; A[mid] == key A[mid] A mid key return true; true if(A[mid] < key) left = mid + 1;
            else right = mid; A[mid] < key A[mid] A mid key left = mid + 1 left mid + 1 mid 1 right = mid right mid return false; false int[] A A int n n int key key public class Main{

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int[] S = new int[100000];
        int[] T = new int[50000];
        String[] in_S = br.readLine().split(" ");
        for(int i = 0; i < n; i++){
            S[i] = Integer.parseInt(in_S[i]);
        }
        int q = Integer.parseInt(br.readLine());
        String[] in_T = br.readLine().split(" ");
        int sum = 0;
        for(int i = 0; i < q; i++){
            T[i] = Integer.parseInt(in_T[i]);
            if( binarySearch(S, n, T[i])) sum++;
        }
        System.out.println(sum);
    }

    public static boolean binarySearch(int[] A, int n, int key){
        int left = 0;
        int right = n;
        int mid;
        while(left < right){
            mid = (left + right) / 2;
            if(A[mid] == key) return true;
            else if(A[mid] < key) left = mid + 1;
            else right = mid;
        }
        return false;
    }

} public class Main{

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int[] S = new int[100000];
        int[] T = new int[50000];
        String[] in_S = br.readLine().split(" ");
        for(int i = 0; i < n; i++){
            S[i] = Integer.parseInt(in_S[i]);
        }
        int q = Integer.parseInt(br.readLine());
        String[] in_T = br.readLine().split(" ");
        int sum = 0;
        for(int i = 0; i < q; i++){
            T[i] = Integer.parseInt(in_T[i]);
            if( binarySearch(S, n, T[i])) sum++;
        }
        System.out.println(sum);
    }

    public static boolean binarySearch(int[] A, int n, int key){
        int left = 0;
        int right = n;
        int mid;
        while(left < right){
            mid = (left + right) / 2;
            if(A[mid] == key) return true;
            else if(A[mid] < key) left = mid + 1;
            else right = mid;
        }
        return false;
    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main{

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int[] S = new int[100000];
        int[] T = new int[50000];
        String[] in_S = br.readLine().split(" ");
        for(int i = 0; i < n; i++){
            S[i] = Integer.parseInt(in_S[i]);
        }
        int q = Integer.parseInt(br.readLine());
        String[] in_T = br.readLine().split(" ");
        int sum = 0;
        for(int i = 0; i < q; i++){
            T[i] = Integer.parseInt(in_T[i]);
            if( binarySearch(S, n, T[i])) sum++;
        }
        System.out.println(sum);
    }

    public static boolean binarySearch(int[] A, int n, int key){
        int left = 0;
        int right = n;
        int mid;
        while(left < right){
            mid = (left + right) / 2;
            if(A[mid] == key) return true;
            else if(A[mid] < key) left = mid + 1;
            else right = mid;
        }
        return false;
    }

}