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


class Main {


   public static void main(String args[]) throws IOException{

	   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	   int n = Integer.parseInt( br.readLine() );
	   String[] string =  br.readLine().split(" ");
       int[] S = new int[n];


       for(int i = 0; i < n; i++ ){

    	   S[i] = Integer.parseInt( string[i] );

       }

       int q = Integer.parseInt( br.readLine() );
	   String[] stringq =  br.readLine().split(" ");
       int[] T = new int[q];


       for(int i = 0; i < q; i++ ){

    	   T[i] = Integer.parseInt( stringq[i] );

       }


       int answer = 0;


       for(int i = 0; i < q ; i++ ){

           answer += binarysearch(S , n, 0, T[i] );

       }

     System.out.println(answer);


   }




   public static int binarysearch(int[] S, int right, int left, int key){


	   while(left < right){
		   int mid = (right + left)/2;
           if( S[mid] == key ){
              return 1;
           }
           else if(key < S[mid] ){
        	  right = mid;
           }
           else{
        	   left = mid + 1;
           }
	   }


	   return 0;
   }


} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {


   public static void main(String args[]) throws IOException{

	   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	   int n = Integer.parseInt( br.readLine() );
	   String[] string =  br.readLine().split(" ");
       int[] S = new int[n];


       for(int i = 0; i < n; i++ ){

    	   S[i] = Integer.parseInt( string[i] );

       }

       int q = Integer.parseInt( br.readLine() );
	   String[] stringq =  br.readLine().split(" ");
       int[] T = new int[q];


       for(int i = 0; i < q; i++ ){

    	   T[i] = Integer.parseInt( stringq[i] );

       }


       int answer = 0;


       for(int i = 0; i < q ; i++ ){

           answer += binarysearch(S , n, 0, T[i] );

       }

     System.out.println(answer);


   }




   public static int binarysearch(int[] S, int right, int left, int key){


	   while(left < right){
		   int mid = (right + left)/2;
           if( S[mid] == key ){
              return 1;
           }
           else if(key < S[mid] ){
        	  right = mid;
           }
           else{
        	   left = mid + 1;
           }
	   }


	   return 0;
   }


} Main public static void main(String args[]) throws IOException{

	   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	   int n = Integer.parseInt( br.readLine() );
	   String[] string =  br.readLine().split(" ");
       int[] S = new int[n];


       for(int i = 0; i < n; i++ ){

    	   S[i] = Integer.parseInt( string[i] );

       }

       int q = Integer.parseInt( br.readLine() );
	   String[] stringq =  br.readLine().split(" ");
       int[] T = new int[q];


       for(int i = 0; i < q; i++ ){

    	   T[i] = Integer.parseInt( stringq[i] );

       }


       int answer = 0;


       for(int i = 0; i < q ; i++ ){

           answer += binarysearch(S , n, 0, T[i] );

       }

     System.out.println(answer);


   } main {

	   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	   int n = Integer.parseInt( br.readLine() );
	   String[] string =  br.readLine().split(" ");
       int[] S = new int[n];


       for(int i = 0; i < n; i++ ){

    	   S[i] = Integer.parseInt( string[i] );

       }

       int q = Integer.parseInt( br.readLine() );
	   String[] stringq =  br.readLine().split(" ");
       int[] T = new int[q];


       for(int i = 0; i < q; i++ ){

    	   T[i] = Integer.parseInt( stringq[i] );

       }


       int answer = 0;


       for(int i = 0; i < q ; i++ ){

           answer += binarysearch(S , n, 0, T[i] );

       }

     System.out.println(answer);


   } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt( br.readLine() ); n Integer.parseInt( br.readLine() ) Integer.parseInt Integer br.readLine() br.readLine br String[] string =  br.readLine().split(" "); string br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] S = new int[n]; S new int[n] n for(int i = 0; i < n; i++ ){

    	   S[i] = Integer.parseInt( string[i] );

       } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

    	   S[i] = Integer.parseInt( string[i] );

       } {

    	   S[i] = Integer.parseInt( string[i] );

       } S[i] = Integer.parseInt( string[i] ) S[i] S i Integer.parseInt( string[i] ) Integer.parseInt Integer string[i] string i int q = Integer.parseInt( br.readLine() ); q Integer.parseInt( br.readLine() ) Integer.parseInt Integer br.readLine() br.readLine br String[] stringq =  br.readLine().split(" "); stringq br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] T = new int[q]; T new int[q] q for(int i = 0; i < q; i++ ){

    	   T[i] = Integer.parseInt( stringq[i] );

       } int i = 0; int i = 0; i 0 i < q i q i++ i++ i {

    	   T[i] = Integer.parseInt( stringq[i] );

       } {

    	   T[i] = Integer.parseInt( stringq[i] );

       } T[i] = Integer.parseInt( stringq[i] ) T[i] T i Integer.parseInt( stringq[i] ) Integer.parseInt Integer stringq[i] stringq i int answer = 0; answer 0 for(int i = 0; i < q ; i++ ){

           answer += binarysearch(S , n, 0, T[i] );

       } int i = 0; int i = 0; i 0 i < q i q i++ i++ i {

           answer += binarysearch(S , n, 0, T[i] );

       } {

           answer += binarysearch(S , n, 0, T[i] );

       } answer += binarysearch(S , n, 0, T[i] ) answer binarysearch(S , n, 0, T[i] ) binarysearch S n 0 T[i] T i System.out.println(answer) System.out.println System.out System System.out answer String args[] args public static int binarysearch(int[] S, int right, int left, int key){


	   while(left < right){
		   int mid = (right + left)/2;
           if( S[mid] == key ){
              return 1;
           }
           else if(key < S[mid] ){
        	  right = mid;
           }
           else{
        	   left = mid + 1;
           }
	   }


	   return 0;
   } binarysearch {


	   while(left < right){
		   int mid = (right + left)/2;
           if( S[mid] == key ){
              return 1;
           }
           else if(key < S[mid] ){
        	  right = mid;
           }
           else{
        	   left = mid + 1;
           }
	   }


	   return 0;
   } while(left < right){
		   int mid = (right + left)/2;
           if( S[mid] == key ){
              return 1;
           }
           else if(key < S[mid] ){
        	  right = mid;
           }
           else{
        	   left = mid + 1;
           }
	   } left < right left right {
		   int mid = (right + left)/2;
           if( S[mid] == key ){
              return 1;
           }
           else if(key < S[mid] ){
        	  right = mid;
           }
           else{
        	   left = mid + 1;
           }
	   } int mid = (right + left)/2; mid (right + left)/2 (right + left) right left 2 if( S[mid] == key ){
              return 1;
           }
           else if(key < S[mid] ){
        	  right = mid;
           }
           else{
        	   left = mid + 1;
           } S[mid] == key S[mid] S mid key {
              return 1;
           } return 1; 1 if(key < S[mid] ){
        	  right = mid;
           }
           else{
        	   left = mid + 1;
           } key < S[mid] key S[mid] S mid {
        	  right = mid;
           } right = mid right mid {
        	   left = mid + 1;
           } left = mid + 1 left mid + 1 mid 1 return 0; 0 int[] S S int right right int left left int key key
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


class Main {


   public static void main(String args[]) throws IOException{

	   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	   int n = Integer.parseInt( br.readLine() );
	   String[] string =  br.readLine().split(" ");
       int[] S = new int[n];


       for(int i = 0; i < n; i++ ){

    	   S[i] = Integer.parseInt( string[i] );

       }

       int q = Integer.parseInt( br.readLine() );
	   String[] stringq =  br.readLine().split(" ");
       int[] T = new int[q];


       for(int i = 0; i < q; i++ ){

    	   T[i] = Integer.parseInt( stringq[i] );

       }


       int answer = 0;


       for(int i = 0; i < q ; i++ ){

           answer += binarysearch(S , n, 0, T[i] );

       }

     System.out.println(answer);


   }




   public static int binarysearch(int[] S, int right, int left, int key){


	   while(left < right){
		   int mid = (right + left)/2;
           if( S[mid] == key ){
              return 1;
           }
           else if(key < S[mid] ){
        	  right = mid;
           }
           else{
        	   left = mid + 1;
           }
	   }


	   return 0;
   }


}