import java.io.*;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n=Integer.parseInt(br.readLine());
        String[] str=br.readLine().split(" ");
        int[] S=new int[n];
        for(int i=0;i<n;i++)
            S[i]=Integer.parseInt(str[i]);
         
        int q=Integer.parseInt(br.readLine());
        str=br.readLine().split(" ");
        int[] T=new int[q];
        for(int i=0;i<q;i++)
            T[i]=Integer.parseInt(str[i]);
         
        System.out.println(method(S,T));
         
 
    }
    static int method(int[] s,int[] t){
        if(s.length<t.length){
            int[] tmp=s;
            s=t;
            t=tmp;
        }
        
        int count=0;
        for(int i=0;i<t.length;i++){
        	if(s[s.length/2]==t[i]){count++;continue;}
        	else if(s[s.length/2]<t[i]){
        		for(int j=s.length/2;j<s.length;j++)
        			if(t[i]==s[j]){count++;break;}}
        	
        	else
        		for(int j=0;j<s.length/2;j++)
        			if(t[i]==s[j]){count++;break;}
        	
        
                   
            
        }
         
        return count;
    }
 
} import java.io.*; io.* java public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n=Integer.parseInt(br.readLine());
        String[] str=br.readLine().split(" ");
        int[] S=new int[n];
        for(int i=0;i<n;i++)
            S[i]=Integer.parseInt(str[i]);
         
        int q=Integer.parseInt(br.readLine());
        str=br.readLine().split(" ");
        int[] T=new int[q];
        for(int i=0;i<q;i++)
            T[i]=Integer.parseInt(str[i]);
         
        System.out.println(method(S,T));
         
 
    }
    static int method(int[] s,int[] t){
        if(s.length<t.length){
            int[] tmp=s;
            s=t;
            t=tmp;
        }
        
        int count=0;
        for(int i=0;i<t.length;i++){
        	if(s[s.length/2]==t[i]){count++;continue;}
        	else if(s[s.length/2]<t[i]){
        		for(int j=s.length/2;j<s.length;j++)
        			if(t[i]==s[j]){count++;break;}}
        	
        	else
        		for(int j=0;j<s.length/2;j++)
        			if(t[i]==s[j]){count++;break;}
        	
        
                   
            
        }
         
        return count;
    }
 
} Main public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n=Integer.parseInt(br.readLine());
        String[] str=br.readLine().split(" ");
        int[] S=new int[n];
        for(int i=0;i<n;i++)
            S[i]=Integer.parseInt(str[i]);
         
        int q=Integer.parseInt(br.readLine());
        str=br.readLine().split(" ");
        int[] T=new int[q];
        for(int i=0;i<q;i++)
            T[i]=Integer.parseInt(str[i]);
         
        System.out.println(method(S,T));
         
 
    } main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n=Integer.parseInt(br.readLine());
        String[] str=br.readLine().split(" ");
        int[] S=new int[n];
        for(int i=0;i<n;i++)
            S[i]=Integer.parseInt(str[i]);
         
        int q=Integer.parseInt(br.readLine());
        str=br.readLine().split(" ");
        int[] T=new int[q];
        for(int i=0;i<q;i++)
            T[i]=Integer.parseInt(str[i]);
         
        System.out.println(method(S,T));
         
 
    } 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[] str=br.readLine().split(" "); str 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(str[i]); int i=0; int i=0; i 0 i<n i n i++ i++ i S[i]=Integer.parseInt(str[i]); S[i]=Integer.parseInt(str[i]) S[i] S i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i int q=Integer.parseInt(br.readLine()); q Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br str=br.readLine().split(" ") str 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(str[i]); int i=0; int i=0; i 0 i<q i q i++ i++ i T[i]=Integer.parseInt(str[i]); T[i]=Integer.parseInt(str[i]) T[i] T i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i System.out.println(method(S,T)) System.out.println System.out System System.out method(S,T) method S T String[] args args static int method(int[] s,int[] t){
        if(s.length<t.length){
            int[] tmp=s;
            s=t;
            t=tmp;
        }
        
        int count=0;
        for(int i=0;i<t.length;i++){
        	if(s[s.length/2]==t[i]){count++;continue;}
        	else if(s[s.length/2]<t[i]){
        		for(int j=s.length/2;j<s.length;j++)
        			if(t[i]==s[j]){count++;break;}}
        	
        	else
        		for(int j=0;j<s.length/2;j++)
        			if(t[i]==s[j]){count++;break;}
        	
        
                   
            
        }
         
        return count;
    } method {
        if(s.length<t.length){
            int[] tmp=s;
            s=t;
            t=tmp;
        }
        
        int count=0;
        for(int i=0;i<t.length;i++){
        	if(s[s.length/2]==t[i]){count++;continue;}
        	else if(s[s.length/2]<t[i]){
        		for(int j=s.length/2;j<s.length;j++)
        			if(t[i]==s[j]){count++;break;}}
        	
        	else
        		for(int j=0;j<s.length/2;j++)
        			if(t[i]==s[j]){count++;break;}
        	
        
                   
            
        }
         
        return count;
    } if(s.length<t.length){
            int[] tmp=s;
            s=t;
            t=tmp;
        } s.length<t.length s.length s s.length t.length t t.length {
            int[] tmp=s;
            s=t;
            t=tmp;
        } int[] tmp=s; tmp s s=t s t t=tmp t tmp int count=0; count 0 for(int i=0;i<t.length;i++){
        	if(s[s.length/2]==t[i]){count++;continue;}
        	else if(s[s.length/2]<t[i]){
        		for(int j=s.length/2;j<s.length;j++)
        			if(t[i]==s[j]){count++;break;}}
        	
        	else
        		for(int j=0;j<s.length/2;j++)
        			if(t[i]==s[j]){count++;break;}
        	
        
                   
            
        } int i=0; int i=0; i 0 i<t.length i t.length t t.length i++ i++ i {
        	if(s[s.length/2]==t[i]){count++;continue;}
        	else if(s[s.length/2]<t[i]){
        		for(int j=s.length/2;j<s.length;j++)
        			if(t[i]==s[j]){count++;break;}}
        	
        	else
        		for(int j=0;j<s.length/2;j++)
        			if(t[i]==s[j]){count++;break;}
        	
        
                   
            
        } {
        	if(s[s.length/2]==t[i]){count++;continue;}
        	else if(s[s.length/2]<t[i]){
        		for(int j=s.length/2;j<s.length;j++)
        			if(t[i]==s[j]){count++;break;}}
        	
        	else
        		for(int j=0;j<s.length/2;j++)
        			if(t[i]==s[j]){count++;break;}
        	
        
                   
            
        } if(s[s.length/2]==t[i]){count++;continue;}
        	else if(s[s.length/2]<t[i]){
        		for(int j=s.length/2;j<s.length;j++)
        			if(t[i]==s[j]){count++;break;}}
        	
        	else
        		for(int j=0;j<s.length/2;j++)
        			if(t[i]==s[j]){count++;break;} s[s.length/2]==t[i] s[s.length/2] s s.length/2 s.length s s.length 2 t[i] t i {count++;continue;} count++ count continue; if(s[s.length/2]<t[i]){
        		for(int j=s.length/2;j<s.length;j++)
        			if(t[i]==s[j]){count++;break;}}
        	
        	else
        		for(int j=0;j<s.length/2;j++)
        			if(t[i]==s[j]){count++;break;} s[s.length/2]<t[i] s[s.length/2] s s.length/2 s.length s s.length 2 t[i] t i {
        		for(int j=s.length/2;j<s.length;j++)
        			if(t[i]==s[j]){count++;break;}} for(int j=s.length/2;j<s.length;j++)
        			if(t[i]==s[j]){count++;break;} int j=s.length/2; int j=s.length/2; j s.length/2 s.length s s.length 2 j<s.length j s.length s s.length j++ j++ j if(t[i]==s[j]){count++;break;} if(t[i]==s[j]){count++;break;} t[i]==s[j] t[i] t i s[j] s j {count++;break;} count++ count break; for(int j=0;j<s.length/2;j++)
        			if(t[i]==s[j]){count++;break;} int j=0; int j=0; j 0 j<s.length/2 j s.length/2 s.length s s.length 2 j++ j++ j if(t[i]==s[j]){count++;break;} if(t[i]==s[j]){count++;break;} t[i]==s[j] t[i] t i s[j] s j {count++;break;} count++ count break; return count; count int[] s s int[] t t public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n=Integer.parseInt(br.readLine());
        String[] str=br.readLine().split(" ");
        int[] S=new int[n];
        for(int i=0;i<n;i++)
            S[i]=Integer.parseInt(str[i]);
         
        int q=Integer.parseInt(br.readLine());
        str=br.readLine().split(" ");
        int[] T=new int[q];
        for(int i=0;i<q;i++)
            T[i]=Integer.parseInt(str[i]);
         
        System.out.println(method(S,T));
         
 
    }
    static int method(int[] s,int[] t){
        if(s.length<t.length){
            int[] tmp=s;
            s=t;
            t=tmp;
        }
        
        int count=0;
        for(int i=0;i<t.length;i++){
        	if(s[s.length/2]==t[i]){count++;continue;}
        	else if(s[s.length/2]<t[i]){
        		for(int j=s.length/2;j<s.length;j++)
        			if(t[i]==s[j]){count++;break;}}
        	
        	else
        		for(int j=0;j<s.length/2;j++)
        			if(t[i]==s[j]){count++;break;}
        	
        
                   
            
        }
         
        return count;
    }
 
} public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n=Integer.parseInt(br.readLine());
        String[] str=br.readLine().split(" ");
        int[] S=new int[n];
        for(int i=0;i<n;i++)
            S[i]=Integer.parseInt(str[i]);
         
        int q=Integer.parseInt(br.readLine());
        str=br.readLine().split(" ");
        int[] T=new int[q];
        for(int i=0;i<q;i++)
            T[i]=Integer.parseInt(str[i]);
         
        System.out.println(method(S,T));
         
 
    }
    static int method(int[] s,int[] t){
        if(s.length<t.length){
            int[] tmp=s;
            s=t;
            t=tmp;
        }
        
        int count=0;
        for(int i=0;i<t.length;i++){
        	if(s[s.length/2]==t[i]){count++;continue;}
        	else if(s[s.length/2]<t[i]){
        		for(int j=s.length/2;j<s.length;j++)
        			if(t[i]==s[j]){count++;break;}}
        	
        	else
        		for(int j=0;j<s.length/2;j++)
        			if(t[i]==s[j]){count++;break;}
        	
        
                   
            
        }
         
        return count;
    }
 
} Main
import java.io.*;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n=Integer.parseInt(br.readLine());
        String[] str=br.readLine().split(" ");
        int[] S=new int[n];
        for(int i=0;i<n;i++)
            S[i]=Integer.parseInt(str[i]);
         
        int q=Integer.parseInt(br.readLine());
        str=br.readLine().split(" ");
        int[] T=new int[q];
        for(int i=0;i<q;i++)
            T[i]=Integer.parseInt(str[i]);
         
        System.out.println(method(S,T));
         
 
    }
    static int method(int[] s,int[] t){
        if(s.length<t.length){
            int[] tmp=s;
            s=t;
            t=tmp;
        }
        
        int count=0;
        for(int i=0;i<t.length;i++){
        	if(s[s.length/2]==t[i]){count++;continue;}
        	else if(s[s.length/2]<t[i]){
        		for(int j=s.length/2;j<s.length;j++)
        			if(t[i]==s[j]){count++;break;}}
        	
        	else
        		for(int j=0;j<s.length/2;j++)
        			if(t[i]==s[j]){count++;break;}
        	
        
                   
            
        }
         
        return count;
    }
 
}