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

class Main{
    public static void main(String[] args) throws IOException{
        final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        final int n = Integer.parseInt(br.readLine());
        final String[] in = br.readLine().split(" ");
        final int[] s = new int[n];
        for(int i = 0; i<n; i++){
            s[i] = Integer.parseInt(in[i]);
        }
        int c = 0;
        br.readLine();
        final String[] t = br.readLine().split(" ");
        for(final String ti:t){
            if(Arrays.binarySearch(s, Integer.parseInt(ti))>=0) c++;
        }
        System.out.println(c);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util class Main{
    public static void main(String[] args) throws IOException{
        final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        final int n = Integer.parseInt(br.readLine());
        final String[] in = br.readLine().split(" ");
        final int[] s = new int[n];
        for(int i = 0; i<n; i++){
            s[i] = Integer.parseInt(in[i]);
        }
        int c = 0;
        br.readLine();
        final String[] t = br.readLine().split(" ");
        for(final String ti:t){
            if(Arrays.binarySearch(s, Integer.parseInt(ti))>=0) c++;
        }
        System.out.println(c);
    }
} Main public static void main(String[] args) throws IOException{
        final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        final int n = Integer.parseInt(br.readLine());
        final String[] in = br.readLine().split(" ");
        final int[] s = new int[n];
        for(int i = 0; i<n; i++){
            s[i] = Integer.parseInt(in[i]);
        }
        int c = 0;
        br.readLine();
        final String[] t = br.readLine().split(" ");
        for(final String ti:t){
            if(Arrays.binarySearch(s, Integer.parseInt(ti))>=0) c++;
        }
        System.out.println(c);
    } main {
        final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        final int n = Integer.parseInt(br.readLine());
        final String[] in = br.readLine().split(" ");
        final int[] s = new int[n];
        for(int i = 0; i<n; i++){
            s[i] = Integer.parseInt(in[i]);
        }
        int c = 0;
        br.readLine();
        final String[] t = br.readLine().split(" ");
        for(final String ti:t){
            if(Arrays.binarySearch(s, Integer.parseInt(ti))>=0) c++;
        }
        System.out.println(c);
    } final BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) final int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br final String[] in = br.readLine().split(" "); in br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " final int[] s = new int[n]; s new int[n] n for(int i = 0; i<n; i++){
            s[i] = Integer.parseInt(in[i]);
        } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
            s[i] = Integer.parseInt(in[i]);
        } {
            s[i] = Integer.parseInt(in[i]);
        } s[i] = Integer.parseInt(in[i]) s[i] s i Integer.parseInt(in[i]) Integer.parseInt Integer in[i] in i int c = 0; c 0 br.readLine() br.readLine br final String[] t = br.readLine().split(" "); t br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for(final String ti:t){
            if(Arrays.binarySearch(s, Integer.parseInt(ti))>=0) c++;
        } final String ti t {
            if(Arrays.binarySearch(s, Integer.parseInt(ti))>=0) c++;
        } {
            if(Arrays.binarySearch(s, Integer.parseInt(ti))>=0) c++;
        } if(Arrays.binarySearch(s, Integer.parseInt(ti))>=0) c++; Arrays.binarySearch(s, Integer.parseInt(ti))>=0 Arrays.binarySearch(s, Integer.parseInt(ti)) Arrays.binarySearch Arrays s Integer.parseInt(ti) Integer.parseInt Integer ti 0 c++ c System.out.println(c) System.out.println System.out System System.out c String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

class Main{
    public static void main(String[] args) throws IOException{
        final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        final int n = Integer.parseInt(br.readLine());
        final String[] in = br.readLine().split(" ");
        final int[] s = new int[n];
        for(int i = 0; i<n; i++){
            s[i] = Integer.parseInt(in[i]);
        }
        int c = 0;
        br.readLine();
        final String[] t = br.readLine().split(" ");
        for(final String ti:t){
            if(Arrays.binarySearch(s, Integer.parseInt(ti))>=0) c++;
        }
        System.out.println(c);
    }
}