import java.io.*;

class Main {
    public static void main(String[] args) {
        try {
        	BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
        	int n = Integer.parseInt( kb.readLine( ) );
			String[] str = kb.readLine( ).split( " " );
			int[] S = new int[ n ];
			for( int i=0; i<n; i++ ) {
				S[i] = Integer.parseInt( str[i] );
			}

        	int q = Integer.parseInt( kb.readLine( ) );
			str = kb.readLine( ).split( " " );
			int[] T = new int[ q ];
			for( int i=0; i<q; i++ ) {
				T[i] = Integer.parseInt( str[i] );
			}

			int cnt = 0;
			for( int i=0; i<q; i++ ) {
				for( int j=0; j<n; j++ ) {
					if( T[i] == S[j] ) {
						cnt++;
						break;
					}
				}
			}
			System.out.println( cnt );

        } catch( IOException e ) {
            System.err.println( e );
        }
    }
} import java.io.*; io.* java class Main {
    public static void main(String[] args) {
        try {
        	BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
        	int n = Integer.parseInt( kb.readLine( ) );
			String[] str = kb.readLine( ).split( " " );
			int[] S = new int[ n ];
			for( int i=0; i<n; i++ ) {
				S[i] = Integer.parseInt( str[i] );
			}

        	int q = Integer.parseInt( kb.readLine( ) );
			str = kb.readLine( ).split( " " );
			int[] T = new int[ q ];
			for( int i=0; i<q; i++ ) {
				T[i] = Integer.parseInt( str[i] );
			}

			int cnt = 0;
			for( int i=0; i<q; i++ ) {
				for( int j=0; j<n; j++ ) {
					if( T[i] == S[j] ) {
						cnt++;
						break;
					}
				}
			}
			System.out.println( cnt );

        } catch( IOException e ) {
            System.err.println( e );
        }
    }
} Main public static void main(String[] args) {
        try {
        	BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
        	int n = Integer.parseInt( kb.readLine( ) );
			String[] str = kb.readLine( ).split( " " );
			int[] S = new int[ n ];
			for( int i=0; i<n; i++ ) {
				S[i] = Integer.parseInt( str[i] );
			}

        	int q = Integer.parseInt( kb.readLine( ) );
			str = kb.readLine( ).split( " " );
			int[] T = new int[ q ];
			for( int i=0; i<q; i++ ) {
				T[i] = Integer.parseInt( str[i] );
			}

			int cnt = 0;
			for( int i=0; i<q; i++ ) {
				for( int j=0; j<n; j++ ) {
					if( T[i] == S[j] ) {
						cnt++;
						break;
					}
				}
			}
			System.out.println( cnt );

        } catch( IOException e ) {
            System.err.println( e );
        }
    } main {
        try {
        	BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
        	int n = Integer.parseInt( kb.readLine( ) );
			String[] str = kb.readLine( ).split( " " );
			int[] S = new int[ n ];
			for( int i=0; i<n; i++ ) {
				S[i] = Integer.parseInt( str[i] );
			}

        	int q = Integer.parseInt( kb.readLine( ) );
			str = kb.readLine( ).split( " " );
			int[] T = new int[ q ];
			for( int i=0; i<q; i++ ) {
				T[i] = Integer.parseInt( str[i] );
			}

			int cnt = 0;
			for( int i=0; i<q; i++ ) {
				for( int j=0; j<n; j++ ) {
					if( T[i] == S[j] ) {
						cnt++;
						break;
					}
				}
			}
			System.out.println( cnt );

        } catch( IOException e ) {
            System.err.println( e );
        }
    } try {
        	BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
        	int n = Integer.parseInt( kb.readLine( ) );
			String[] str = kb.readLine( ).split( " " );
			int[] S = new int[ n ];
			for( int i=0; i<n; i++ ) {
				S[i] = Integer.parseInt( str[i] );
			}

        	int q = Integer.parseInt( kb.readLine( ) );
			str = kb.readLine( ).split( " " );
			int[] T = new int[ q ];
			for( int i=0; i<q; i++ ) {
				T[i] = Integer.parseInt( str[i] );
			}

			int cnt = 0;
			for( int i=0; i<q; i++ ) {
				for( int j=0; j<n; j++ ) {
					if( T[i] == S[j] ) {
						cnt++;
						break;
					}
				}
			}
			System.out.println( cnt );

        } catch( IOException e ) {
            System.err.println( e );
        } catch( IOException e ) {
            System.err.println( e );
        } IOException e {
            System.err.println( e );
        } System.err.println( e ) System.err.println System.err System System.err e {
        	BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
        	int n = Integer.parseInt( kb.readLine( ) );
			String[] str = kb.readLine( ).split( " " );
			int[] S = new int[ n ];
			for( int i=0; i<n; i++ ) {
				S[i] = Integer.parseInt( str[i] );
			}

        	int q = Integer.parseInt( kb.readLine( ) );
			str = kb.readLine( ).split( " " );
			int[] T = new int[ q ];
			for( int i=0; i<q; i++ ) {
				T[i] = Integer.parseInt( str[i] );
			}

			int cnt = 0;
			for( int i=0; i<q; i++ ) {
				for( int j=0; j<n; j++ ) {
					if( T[i] == S[j] ) {
						cnt++;
						break;
					}
				}
			}
			System.out.println( cnt );

        } BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) ); kb new BufferedReader( new InputStreamReader( System.in ) ) int n = Integer.parseInt( kb.readLine( ) ); n Integer.parseInt( kb.readLine( ) ) Integer.parseInt Integer kb.readLine( ) kb.readLine kb String[] str = kb.readLine( ).split( " " ); str kb.readLine( ).split( " " ) kb.readLine( ).split kb.readLine( ) kb.readLine kb " " 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] = Integer.parseInt( str[i] ) S[i] S i Integer.parseInt( str[i] ) Integer.parseInt Integer str[i] str i int q = Integer.parseInt( kb.readLine( ) ); q Integer.parseInt( kb.readLine( ) ) Integer.parseInt Integer kb.readLine( ) kb.readLine kb str = kb.readLine( ).split( " " ) str kb.readLine( ).split( " " ) kb.readLine( ).split kb.readLine( ) kb.readLine kb " " 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] = Integer.parseInt( str[i] ) T[i] T i Integer.parseInt( str[i] ) Integer.parseInt Integer str[i] str i int cnt = 0; cnt 0 for( int i=0; i<q; i++ ) {
				for( int j=0; j<n; j++ ) {
					if( T[i] == S[j] ) {
						cnt++;
						break;
					}
				}
			} int i=0; int i=0; i 0 i<q i q i++ i++ i {
				for( int j=0; j<n; j++ ) {
					if( T[i] == S[j] ) {
						cnt++;
						break;
					}
				}
			} {
				for( int j=0; j<n; j++ ) {
					if( T[i] == S[j] ) {
						cnt++;
						break;
					}
				}
			} for( int j=0; j<n; j++ ) {
					if( T[i] == S[j] ) {
						cnt++;
						break;
					}
				} int j=0; int j=0; j 0 j<n j n j++ j++ j {
					if( T[i] == S[j] ) {
						cnt++;
						break;
					}
				} {
					if( T[i] == S[j] ) {
						cnt++;
						break;
					}
				} if( T[i] == S[j] ) {
						cnt++;
						break;
					} T[i] == S[j] T[i] T i S[j] S j {
						cnt++;
						break;
					} cnt++ cnt break; System.out.println( cnt ) System.out.println System.out System System.out cnt String[] args args
import java.io.*;

class Main {
    public static void main(String[] args) {
        try {
        	BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
        	int n = Integer.parseInt( kb.readLine( ) );
			String[] str = kb.readLine( ).split( " " );
			int[] S = new int[ n ];
			for( int i=0; i<n; i++ ) {
				S[i] = Integer.parseInt( str[i] );
			}

        	int q = Integer.parseInt( kb.readLine( ) );
			str = kb.readLine( ).split( " " );
			int[] T = new int[ q ];
			for( int i=0; i<q; i++ ) {
				T[i] = Integer.parseInt( str[i] );
			}

			int cnt = 0;
			for( int i=0; i<q; i++ ) {
				for( int j=0; j<n; j++ ) {
					if( T[i] == S[j] ) {
						cnt++;
						break;
					}
				}
			}
			System.out.println( cnt );

        } catch( IOException e ) {
            System.err.println( e );
        }
    }
}