import java.util.Scanner;

public class Main {
    static Scanner sc = new Scanner(System.in);
    static int n = Integer.parseInt(sc.next());
    static int[] a = new int[100000];

    public static void main(String[] args){
        int q,key,sum = 0;
        for (int i = 0; i < n; i++) {
            a[i] = Integer.parseInt(sc.next());
        }
        q = Integer.parseInt(sc.next());
        for (int i = 0; i < q; i++) {
            key = Integer.parseInt(sc.next());
            if(binarySearch(key)) sum++;
        }
        System.out.println(sum);
    }

    static boolean binarySearch(int key){
        int left = 0;
        int right = n;
        int mid;
        while(left < right){
            mid = (left + right)/2;
            if(key == a[mid]) return true;
            if (key > a[mid]) left = mid + 1;
            else if (key < a[mid]) right = mid;
        }
        return false;
    }
} import java.util.Scanner; Scanner java.util public class Main {
    static Scanner sc = new Scanner(System.in);
    static int n = Integer.parseInt(sc.next());
    static int[] a = new int[100000];

    public static void main(String[] args){
        int q,key,sum = 0;
        for (int i = 0; i < n; i++) {
            a[i] = Integer.parseInt(sc.next());
        }
        q = Integer.parseInt(sc.next());
        for (int i = 0; i < q; i++) {
            key = Integer.parseInt(sc.next());
            if(binarySearch(key)) sum++;
        }
        System.out.println(sum);
    }

    static boolean binarySearch(int key){
        int left = 0;
        int right = n;
        int mid;
        while(left < right){
            mid = (left + right)/2;
            if(key == a[mid]) return true;
            if (key > a[mid]) left = mid + 1;
            else if (key < a[mid]) right = mid;
        }
        return false;
    }
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) static int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc static int[] a = new int[100000]; a new int[100000] 100000 public static void main(String[] args){
        int q,key,sum = 0;
        for (int i = 0; i < n; i++) {
            a[i] = Integer.parseInt(sc.next());
        }
        q = Integer.parseInt(sc.next());
        for (int i = 0; i < q; i++) {
            key = Integer.parseInt(sc.next());
            if(binarySearch(key)) sum++;
        }
        System.out.println(sum);
    } main {
        int q,key,sum = 0;
        for (int i = 0; i < n; i++) {
            a[i] = Integer.parseInt(sc.next());
        }
        q = Integer.parseInt(sc.next());
        for (int i = 0; i < q; i++) {
            key = Integer.parseInt(sc.next());
            if(binarySearch(key)) sum++;
        }
        System.out.println(sum);
    } int q q key key sum = 0; sum 0 for (int i = 0; i < n; i++) {
            a[i] = Integer.parseInt(sc.next());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a[i] = Integer.parseInt(sc.next());
        } {
            a[i] = Integer.parseInt(sc.next());
        } a[i] = Integer.parseInt(sc.next()) a[i] a i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc q = Integer.parseInt(sc.next()) q Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc for (int i = 0; i < q; i++) {
            key = Integer.parseInt(sc.next());
            if(binarySearch(key)) sum++;
        } int i = 0; int i = 0; i 0 i < q i q i++ i++ i {
            key = Integer.parseInt(sc.next());
            if(binarySearch(key)) sum++;
        } {
            key = Integer.parseInt(sc.next());
            if(binarySearch(key)) sum++;
        } key = Integer.parseInt(sc.next()) key Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc if(binarySearch(key)) sum++; binarySearch(key) binarySearch key sum++ sum System.out.println(sum) System.out.println System.out System System.out sum String[] args args static boolean binarySearch(int key){
        int left = 0;
        int right = n;
        int mid;
        while(left < right){
            mid = (left + right)/2;
            if(key == a[mid]) return true;
            if (key > a[mid]) left = mid + 1;
            else if (key < a[mid]) right = mid;
        }
        return false;
    } binarySearch {
        int left = 0;
        int right = n;
        int mid;
        while(left < right){
            mid = (left + right)/2;
            if(key == a[mid]) return true;
            if (key > a[mid]) left = mid + 1;
            else if (key < a[mid]) 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(key == a[mid]) return true;
            if (key > a[mid]) left = mid + 1;
            else if (key < a[mid]) right = mid;
        } left < right left right {
            mid = (left + right)/2;
            if(key == a[mid]) return true;
            if (key > a[mid]) left = mid + 1;
            else if (key < a[mid]) right = mid;
        } mid = (left + right)/2 mid (left + right)/2 (left + right) left right 2 if(key == a[mid]) return true; key == a[mid] key a[mid] a mid return true; true if (key > a[mid]) left = mid + 1;
            else if (key < a[mid]) right = mid; key > a[mid] key a[mid] a mid left = mid + 1 left mid + 1 mid 1 if (key < a[mid]) right = mid; key < a[mid] key a[mid] a mid right = mid right mid return false; false int key key public class Main {
    static Scanner sc = new Scanner(System.in);
    static int n = Integer.parseInt(sc.next());
    static int[] a = new int[100000];

    public static void main(String[] args){
        int q,key,sum = 0;
        for (int i = 0; i < n; i++) {
            a[i] = Integer.parseInt(sc.next());
        }
        q = Integer.parseInt(sc.next());
        for (int i = 0; i < q; i++) {
            key = Integer.parseInt(sc.next());
            if(binarySearch(key)) sum++;
        }
        System.out.println(sum);
    }

    static boolean binarySearch(int key){
        int left = 0;
        int right = n;
        int mid;
        while(left < right){
            mid = (left + right)/2;
            if(key == a[mid]) return true;
            if (key > a[mid]) left = mid + 1;
            else if (key < a[mid]) right = mid;
        }
        return false;
    }
} public class Main {
    static Scanner sc = new Scanner(System.in);
    static int n = Integer.parseInt(sc.next());
    static int[] a = new int[100000];

    public static void main(String[] args){
        int q,key,sum = 0;
        for (int i = 0; i < n; i++) {
            a[i] = Integer.parseInt(sc.next());
        }
        q = Integer.parseInt(sc.next());
        for (int i = 0; i < q; i++) {
            key = Integer.parseInt(sc.next());
            if(binarySearch(key)) sum++;
        }
        System.out.println(sum);
    }

    static boolean binarySearch(int key){
        int left = 0;
        int right = n;
        int mid;
        while(left < right){
            mid = (left + right)/2;
            if(key == a[mid]) return true;
            if (key > a[mid]) left = mid + 1;
            else if (key < a[mid]) right = mid;
        }
        return false;
    }
} Main
import java.util.Scanner;

public class Main {
    static Scanner sc = new Scanner(System.in);
    static int n = Integer.parseInt(sc.next());
    static int[] a = new int[100000];

    public static void main(String[] args){
        int q,key,sum = 0;
        for (int i = 0; i < n; i++) {
            a[i] = Integer.parseInt(sc.next());
        }
        q = Integer.parseInt(sc.next());
        for (int i = 0; i < q; i++) {
            key = Integer.parseInt(sc.next());
            if(binarySearch(key)) sum++;
        }
        System.out.println(sum);
    }

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