
import java.util.*;
import java.util.Arrays;
class Main {
    public static void main(String[] args) {
       
       Scanner scner = new Scanner(System.in);

        int n = scner.nextInt();
        int[] S = new int[n];
        for (int i=0; i<n; i++) {
            S[i] = scner.nextInt();
        }

        int q = scner.nextInt();
        int T = 0;
     
        int num = seSearch(S, T, q, scner);
        System.out.println(num);
       }

    public static int seSearch(int[] a, int b, int f,Scanner c){
     int solve = 0;
     for (int i=0; i<f; ++i){
      b = c.nextInt();
     if (Arrays.binarySearch(a,b) >= 0) {
                solve++;
            }
        
        
    
}
    return solve;

 } 
     } import java.util.*; util.* java import java.util.Arrays; Arrays java.util class Main {
    public static void main(String[] args) {
       
       Scanner scner = new Scanner(System.in);

        int n = scner.nextInt();
        int[] S = new int[n];
        for (int i=0; i<n; i++) {
            S[i] = scner.nextInt();
        }

        int q = scner.nextInt();
        int T = 0;
     
        int num = seSearch(S, T, q, scner);
        System.out.println(num);
       }

    public static int seSearch(int[] a, int b, int f,Scanner c){
     int solve = 0;
     for (int i=0; i<f; ++i){
      b = c.nextInt();
     if (Arrays.binarySearch(a,b) >= 0) {
                solve++;
            }
        
        
    
}
    return solve;

 } 
     } Main public static void main(String[] args) {
       
       Scanner scner = new Scanner(System.in);

        int n = scner.nextInt();
        int[] S = new int[n];
        for (int i=0; i<n; i++) {
            S[i] = scner.nextInt();
        }

        int q = scner.nextInt();
        int T = 0;
     
        int num = seSearch(S, T, q, scner);
        System.out.println(num);
       } main {
       
       Scanner scner = new Scanner(System.in);

        int n = scner.nextInt();
        int[] S = new int[n];
        for (int i=0; i<n; i++) {
            S[i] = scner.nextInt();
        }

        int q = scner.nextInt();
        int T = 0;
     
        int num = seSearch(S, T, q, scner);
        System.out.println(num);
       } Scanner scner = new Scanner(System.in); scner new Scanner(System.in) int n = scner.nextInt(); n scner.nextInt() scner.nextInt scner int[] S = new int[n]; S new int[n] n for (int i=0; i<n; i++) {
            S[i] = scner.nextInt();
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            S[i] = scner.nextInt();
        } {
            S[i] = scner.nextInt();
        } S[i] = scner.nextInt() S[i] S i scner.nextInt() scner.nextInt scner int q = scner.nextInt(); q scner.nextInt() scner.nextInt scner int T = 0; T 0 int num = seSearch(S, T, q, scner); num seSearch(S, T, q, scner) seSearch S T q scner System.out.println(num) System.out.println System.out System System.out num String[] args args public static int seSearch(int[] a, int b, int f,Scanner c){
     int solve = 0;
     for (int i=0; i<f; ++i){
      b = c.nextInt();
     if (Arrays.binarySearch(a,b) >= 0) {
                solve++;
            }
        
        
    
}
    return solve;

 } seSearch {
     int solve = 0;
     for (int i=0; i<f; ++i){
      b = c.nextInt();
     if (Arrays.binarySearch(a,b) >= 0) {
                solve++;
            }
        
        
    
}
    return solve;

 } int solve = 0; solve 0 for (int i=0; i<f; ++i){
      b = c.nextInt();
     if (Arrays.binarySearch(a,b) >= 0) {
                solve++;
            }
        
        
    
} int i=0; int i=0; i 0 i<f i f ++i ++i i {
      b = c.nextInt();
     if (Arrays.binarySearch(a,b) >= 0) {
                solve++;
            }
        
        
    
} {
      b = c.nextInt();
     if (Arrays.binarySearch(a,b) >= 0) {
                solve++;
            }
        
        
    
} b = c.nextInt() b c.nextInt() c.nextInt c if (Arrays.binarySearch(a,b) >= 0) {
                solve++;
            } Arrays.binarySearch(a,b) >= 0 Arrays.binarySearch(a,b) Arrays.binarySearch Arrays a b 0 {
                solve++;
            } solve++ solve return solve; solve int[] a a int b b int f f Scanner c c

import java.util.*;
import java.util.Arrays;
class Main {
    public static void main(String[] args) {
       
       Scanner scner = new Scanner(System.in);

        int n = scner.nextInt();
        int[] S = new int[n];
        for (int i=0; i<n; i++) {
            S[i] = scner.nextInt();
        }

        int q = scner.nextInt();
        int T = 0;
     
        int num = seSearch(S, T, q, scner);
        System.out.println(num);
       }

    public static int seSearch(int[] a, int b, int f,Scanner c){
     int solve = 0;
     for (int i=0; i<f; ++i){
      b = c.nextInt();
     if (Arrays.binarySearch(a,b) >= 0) {
                solve++;
            }
        
        
    
}
    return solve;

 } 
     }
