import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;

/**
 * Created by ??\??? on 2016/12/7.
 */
public class Main {
    static int si(String s){
        return Integer.parseInt(s);
    }
    static void run(String[] args) throws Exception{
        BufferedReader scan = new BufferedReader(new InputStreamReader(System.in));
        int T = si(scan.readLine());
        String[] lines1 = scan.readLine().split(" ");
        int Q = si(scan.readLine());
        String[] lines2 = scan.readLine().split(" ");
        int num = 0;
        for(String a : lines2){
            int l = 0;
            int r = lines1.length-1;
            int m = (l+r)/2;
            while(l<=r){
                if(si(lines1[m])==si(a)){
                    break;
                }
                else if(si(lines1[m]) < si(a)){
                    l = m+1;
                    m = (l+r)/2;
                }
                else{
                    r = m - 1;
                    m = (l+r)/2;
                }
            }
            if(l<=r){
                num++;
            }
        }
        System.out.println(num);
    }
    public static void main(String[] args) throws Exception{
        run(args);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util public class Main {
    static int si(String s){
        return Integer.parseInt(s);
    }
    static void run(String[] args) throws Exception{
        BufferedReader scan = new BufferedReader(new InputStreamReader(System.in));
        int T = si(scan.readLine());
        String[] lines1 = scan.readLine().split(" ");
        int Q = si(scan.readLine());
        String[] lines2 = scan.readLine().split(" ");
        int num = 0;
        for(String a : lines2){
            int l = 0;
            int r = lines1.length-1;
            int m = (l+r)/2;
            while(l<=r){
                if(si(lines1[m])==si(a)){
                    break;
                }
                else if(si(lines1[m]) < si(a)){
                    l = m+1;
                    m = (l+r)/2;
                }
                else{
                    r = m - 1;
                    m = (l+r)/2;
                }
            }
            if(l<=r){
                num++;
            }
        }
        System.out.println(num);
    }
    public static void main(String[] args) throws Exception{
        run(args);
    }
} Main static int si(String s){
        return Integer.parseInt(s);
    } si {
        return Integer.parseInt(s);
    } return Integer.parseInt(s); Integer.parseInt(s) Integer.parseInt Integer s String s s static void run(String[] args) throws Exception{
        BufferedReader scan = new BufferedReader(new InputStreamReader(System.in));
        int T = si(scan.readLine());
        String[] lines1 = scan.readLine().split(" ");
        int Q = si(scan.readLine());
        String[] lines2 = scan.readLine().split(" ");
        int num = 0;
        for(String a : lines2){
            int l = 0;
            int r = lines1.length-1;
            int m = (l+r)/2;
            while(l<=r){
                if(si(lines1[m])==si(a)){
                    break;
                }
                else if(si(lines1[m]) < si(a)){
                    l = m+1;
                    m = (l+r)/2;
                }
                else{
                    r = m - 1;
                    m = (l+r)/2;
                }
            }
            if(l<=r){
                num++;
            }
        }
        System.out.println(num);
    } run {
        BufferedReader scan = new BufferedReader(new InputStreamReader(System.in));
        int T = si(scan.readLine());
        String[] lines1 = scan.readLine().split(" ");
        int Q = si(scan.readLine());
        String[] lines2 = scan.readLine().split(" ");
        int num = 0;
        for(String a : lines2){
            int l = 0;
            int r = lines1.length-1;
            int m = (l+r)/2;
            while(l<=r){
                if(si(lines1[m])==si(a)){
                    break;
                }
                else if(si(lines1[m]) < si(a)){
                    l = m+1;
                    m = (l+r)/2;
                }
                else{
                    r = m - 1;
                    m = (l+r)/2;
                }
            }
            if(l<=r){
                num++;
            }
        }
        System.out.println(num);
    } BufferedReader scan = new BufferedReader(new InputStreamReader(System.in)); scan new BufferedReader(new InputStreamReader(System.in)) int T = si(scan.readLine()); T si(scan.readLine()) si scan.readLine() scan.readLine scan String[] lines1 = scan.readLine().split(" "); lines1 scan.readLine().split(" ") scan.readLine().split scan.readLine() scan.readLine scan " " int Q = si(scan.readLine()); Q si(scan.readLine()) si scan.readLine() scan.readLine scan String[] lines2 = scan.readLine().split(" "); lines2 scan.readLine().split(" ") scan.readLine().split scan.readLine() scan.readLine scan " " int num = 0; num 0 for(String a : lines2){
            int l = 0;
            int r = lines1.length-1;
            int m = (l+r)/2;
            while(l<=r){
                if(si(lines1[m])==si(a)){
                    break;
                }
                else if(si(lines1[m]) < si(a)){
                    l = m+1;
                    m = (l+r)/2;
                }
                else{
                    r = m - 1;
                    m = (l+r)/2;
                }
            }
            if(l<=r){
                num++;
            }
        } String a lines2 {
            int l = 0;
            int r = lines1.length-1;
            int m = (l+r)/2;
            while(l<=r){
                if(si(lines1[m])==si(a)){
                    break;
                }
                else if(si(lines1[m]) < si(a)){
                    l = m+1;
                    m = (l+r)/2;
                }
                else{
                    r = m - 1;
                    m = (l+r)/2;
                }
            }
            if(l<=r){
                num++;
            }
        } {
            int l = 0;
            int r = lines1.length-1;
            int m = (l+r)/2;
            while(l<=r){
                if(si(lines1[m])==si(a)){
                    break;
                }
                else if(si(lines1[m]) < si(a)){
                    l = m+1;
                    m = (l+r)/2;
                }
                else{
                    r = m - 1;
                    m = (l+r)/2;
                }
            }
            if(l<=r){
                num++;
            }
        } int l = 0; l 0 int r = lines1.length-1; r lines1.length-1 lines1.length lines1 lines1.length 1 int m = (l+r)/2; m (l+r)/2 (l+r) l r 2 while(l<=r){
                if(si(lines1[m])==si(a)){
                    break;
                }
                else if(si(lines1[m]) < si(a)){
                    l = m+1;
                    m = (l+r)/2;
                }
                else{
                    r = m - 1;
                    m = (l+r)/2;
                }
            } l<=r l r {
                if(si(lines1[m])==si(a)){
                    break;
                }
                else if(si(lines1[m]) < si(a)){
                    l = m+1;
                    m = (l+r)/2;
                }
                else{
                    r = m - 1;
                    m = (l+r)/2;
                }
            } if(si(lines1[m])==si(a)){
                    break;
                }
                else if(si(lines1[m]) < si(a)){
                    l = m+1;
                    m = (l+r)/2;
                }
                else{
                    r = m - 1;
                    m = (l+r)/2;
                } si(lines1[m])==si(a) si(lines1[m]) si lines1[m] lines1 m si(a) si a {
                    break;
                } break; if(si(lines1[m]) < si(a)){
                    l = m+1;
                    m = (l+r)/2;
                }
                else{
                    r = m - 1;
                    m = (l+r)/2;
                } si(lines1[m]) < si(a) si(lines1[m]) si lines1[m] lines1 m si(a) si a {
                    l = m+1;
                    m = (l+r)/2;
                } l = m+1 l m+1 m 1 m = (l+r)/2 m (l+r)/2 (l+r) l r 2 {
                    r = m - 1;
                    m = (l+r)/2;
                } r = m - 1 r m - 1 m 1 m = (l+r)/2 m (l+r)/2 (l+r) l r 2 if(l<=r){
                num++;
            } l<=r l r {
                num++;
            } num++ num System.out.println(num) System.out.println System.out System System.out num String[] args args public static void main(String[] args) throws Exception{
        run(args);
    } main {
        run(args);
    } run(args) run args String[] args args public class Main {
    static int si(String s){
        return Integer.parseInt(s);
    }
    static void run(String[] args) throws Exception{
        BufferedReader scan = new BufferedReader(new InputStreamReader(System.in));
        int T = si(scan.readLine());
        String[] lines1 = scan.readLine().split(" ");
        int Q = si(scan.readLine());
        String[] lines2 = scan.readLine().split(" ");
        int num = 0;
        for(String a : lines2){
            int l = 0;
            int r = lines1.length-1;
            int m = (l+r)/2;
            while(l<=r){
                if(si(lines1[m])==si(a)){
                    break;
                }
                else if(si(lines1[m]) < si(a)){
                    l = m+1;
                    m = (l+r)/2;
                }
                else{
                    r = m - 1;
                    m = (l+r)/2;
                }
            }
            if(l<=r){
                num++;
            }
        }
        System.out.println(num);
    }
    public static void main(String[] args) throws Exception{
        run(args);
    }
} public class Main {
    static int si(String s){
        return Integer.parseInt(s);
    }
    static void run(String[] args) throws Exception{
        BufferedReader scan = new BufferedReader(new InputStreamReader(System.in));
        int T = si(scan.readLine());
        String[] lines1 = scan.readLine().split(" ");
        int Q = si(scan.readLine());
        String[] lines2 = scan.readLine().split(" ");
        int num = 0;
        for(String a : lines2){
            int l = 0;
            int r = lines1.length-1;
            int m = (l+r)/2;
            while(l<=r){
                if(si(lines1[m])==si(a)){
                    break;
                }
                else if(si(lines1[m]) < si(a)){
                    l = m+1;
                    m = (l+r)/2;
                }
                else{
                    r = m - 1;
                    m = (l+r)/2;
                }
            }
            if(l<=r){
                num++;
            }
        }
        System.out.println(num);
    }
    public static void main(String[] args) throws Exception{
        run(args);
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;

/**
 * Created by ??\??? on 2016/12/7.
 */
public class Main {
    static int si(String s){
        return Integer.parseInt(s);
    }
    static void run(String[] args) throws Exception{
        BufferedReader scan = new BufferedReader(new InputStreamReader(System.in));
        int T = si(scan.readLine());
        String[] lines1 = scan.readLine().split(" ");
        int Q = si(scan.readLine());
        String[] lines2 = scan.readLine().split(" ");
        int num = 0;
        for(String a : lines2){
            int l = 0;
            int r = lines1.length-1;
            int m = (l+r)/2;
            while(l<=r){
                if(si(lines1[m])==si(a)){
                    break;
                }
                else if(si(lines1[m]) < si(a)){
                    l = m+1;
                    m = (l+r)/2;
                }
                else{
                    r = m - 1;
                    m = (l+r)/2;
                }
            }
            if(l<=r){
                num++;
            }
        }
        System.out.println(num);
    }
    public static void main(String[] args) throws Exception{
        run(args);
    }
}