import java.util.*;
class Main{
  static int n;
  public static void main(String args[])throws Exception{
    Scanner sc = new Scanner(System.in);
    int count = 0;
    int number = 0;
    n = sc.nextInt();
    int array_s [] = new int[n];
    for(int i =0; i<n; i++){
      array_s[i] = sc.nextInt();
    }

    int q = sc.nextInt();
    int t;
    for(int i = 0; i<q; i++){
      t = sc.nextInt();
      //二分探索
      count += binarysearch(t, array_s);
    }
    System.out.println(count);
  }

  static int binarysearch(int k , int a[]){
    int left = 0;
    int right = n;
    int mid;
    while(left<right){
      mid = (left+right)/2;
      if(k==a[mid])return 1;
      else if(k<a[mid])right=mid;
      else left = mid+1;
    }
    return 0;
  }
} import java.util.*; util.* java class Main{
  static int n;
  public static void main(String args[])throws Exception{
    Scanner sc = new Scanner(System.in);
    int count = 0;
    int number = 0;
    n = sc.nextInt();
    int array_s [] = new int[n];
    for(int i =0; i<n; i++){
      array_s[i] = sc.nextInt();
    }

    int q = sc.nextInt();
    int t;
    for(int i = 0; i<q; i++){
      t = sc.nextInt();
      //二分探索
      count += binarysearch(t, array_s);
    }
    System.out.println(count);
  }

  static int binarysearch(int k , int a[]){
    int left = 0;
    int right = n;
    int mid;
    while(left<right){
      mid = (left+right)/2;
      if(k==a[mid])return 1;
      else if(k<a[mid])right=mid;
      else left = mid+1;
    }
    return 0;
  }
} Main static int n; n public static void main(String args[])throws Exception{
    Scanner sc = new Scanner(System.in);
    int count = 0;
    int number = 0;
    n = sc.nextInt();
    int array_s [] = new int[n];
    for(int i =0; i<n; i++){
      array_s[i] = sc.nextInt();
    }

    int q = sc.nextInt();
    int t;
    for(int i = 0; i<q; i++){
      t = sc.nextInt();
      //二分探索
      count += binarysearch(t, array_s);
    }
    System.out.println(count);
  } main {
    Scanner sc = new Scanner(System.in);
    int count = 0;
    int number = 0;
    n = sc.nextInt();
    int array_s [] = new int[n];
    for(int i =0; i<n; i++){
      array_s[i] = sc.nextInt();
    }

    int q = sc.nextInt();
    int t;
    for(int i = 0; i<q; i++){
      t = sc.nextInt();
      //二分探索
      count += binarysearch(t, array_s);
    }
    System.out.println(count);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int count = 0; count 0 int number = 0; number 0 n = sc.nextInt() n sc.nextInt() sc.nextInt sc int array_s [] = new int[n]; array_s new int[n] n for(int i =0; i<n; i++){
      array_s[i] = sc.nextInt();
    } int i =0; int i =0; i 0 i<n i n i++ i++ i {
      array_s[i] = sc.nextInt();
    } {
      array_s[i] = sc.nextInt();
    } array_s[i] = sc.nextInt() array_s[i] array_s i sc.nextInt() sc.nextInt sc int q = sc.nextInt(); q sc.nextInt() sc.nextInt sc int t; t for(int i = 0; i<q; i++){
      t = sc.nextInt();
      //二分探索
      count += binarysearch(t, array_s);
    } int i = 0; int i = 0; i 0 i<q i q i++ i++ i {
      t = sc.nextInt();
      //二分探索
      count += binarysearch(t, array_s);
    } {
      t = sc.nextInt();
      //二分探索
      count += binarysearch(t, array_s);
    } t = sc.nextInt() t sc.nextInt() sc.nextInt sc count += binarysearch(t, array_s) count binarysearch(t, array_s) binarysearch t array_s System.out.println(count) System.out.println System.out System System.out count String args[] args static int binarysearch(int k , int a[]){
    int left = 0;
    int right = n;
    int mid;
    while(left<right){
      mid = (left+right)/2;
      if(k==a[mid])return 1;
      else if(k<a[mid])right=mid;
      else left = mid+1;
    }
    return 0;
  } binarysearch {
    int left = 0;
    int right = n;
    int mid;
    while(left<right){
      mid = (left+right)/2;
      if(k==a[mid])return 1;
      else if(k<a[mid])right=mid;
      else left = mid+1;
    }
    return 0;
  } int left = 0; left 0 int right = n; right n int mid; mid while(left<right){
      mid = (left+right)/2;
      if(k==a[mid])return 1;
      else if(k<a[mid])right=mid;
      else left = mid+1;
    } left<right left right {
      mid = (left+right)/2;
      if(k==a[mid])return 1;
      else if(k<a[mid])right=mid;
      else left = mid+1;
    } mid = (left+right)/2 mid (left+right)/2 (left+right) left right 2 if(k==a[mid])return 1;
      else if(k<a[mid])right=mid;
      else left = mid+1; k==a[mid] k a[mid] a mid return 1; 1 if(k<a[mid])right=mid;
      else left = mid+1; k<a[mid] k a[mid] a mid right=mid right mid left = mid+1 left mid+1 mid 1 return 0; 0 int k k int a[] a
import java.util.*;
class Main{
  static int n;
  public static void main(String args[])throws Exception{
    Scanner sc = new Scanner(System.in);
    int count = 0;
    int number = 0;
    n = sc.nextInt();
    int array_s [] = new int[n];
    for(int i =0; i<n; i++){
      array_s[i] = sc.nextInt();
    }

    int q = sc.nextInt();
    int t;
    for(int i = 0; i<q; i++){
      t = sc.nextInt();
      //二分探索
      count += binarysearch(t, array_s);
    }
    System.out.println(count);
  }

  static int binarysearch(int k , int a[]){
    int left = 0;
    int right = n;
    int mid;
    while(left<right){
      mid = (left+right)/2;
      if(k==a[mid])return 1;
      else if(k<a[mid])right=mid;
      else left = mid+1;
    }
    return 0;
  }
}
