n = int( raw_input( ) )
t = [ int( val ) for val in raw_input( ).rstrip( ).split( " " ) ]
q = int( raw_input( ) )
s = [ int( val ) for val in raw_input( ).split( " " ) ]

cnt = 0
for si in s:
	for ti in t:
		if si == ti:
			cnt += 1
			break

print( cnt ) n = int( raw_input( ) ) n int( raw_input( ) ) int raw_input( ) raw_input int( val ) for val in raw_input( ).rstrip( ).split( " " ) for val in raw_input( ).rstrip( ).split( " " ) val raw_input( ).rstrip( ).split( " " ) ( ).rstrip( ).split ( ).rstrip( ) ( ).rstrip ( ) raw_input rstrip split " " for val in raw_input( ).rstrip( ).split( " " ) int( val ) int val t = [ int( val ) for val in raw_input( ).rstrip( ).split( " " ) ] t [ int( val ) for val in raw_input( ).rstrip( ).split( " " ) ] q = int( raw_input( ) ) q int( raw_input( ) ) int raw_input( ) raw_input int( val ) for val in raw_input( ).split( " " ) for val in raw_input( ).split( " " ) val raw_input( ).split( " " ) ( ).split ( ) raw_input split " " for val in raw_input( ).split( " " ) int( val ) int val s = [ int( val ) for val in raw_input( ).split( " " ) ] s [ int( val ) for val in raw_input( ).split( " " ) ] cnt = 0 cnt 0 for si in s:
	for ti in t:
		if si == ti:
			cnt += 1
			break si s for ti in t:
		if si == ti:
			cnt += 1
			break ti t if si == ti:
			cnt += 1
			break si == ti si ti cnt += 1 cnt 1 break print( cnt ) print cnt cnt = 0 0 cnt cnt += 1 1 cnt s = [ int( val ) for val in raw_input( ).split( " " ) ] [ int( val ) for val in raw_input( ).split( " " ) ] s t = [ int( val ) for val in raw_input( ).rstrip( ).split( " " ) ] [ int( val ) for val in raw_input( ).rstrip( ).split( " " ) ] t q = int( raw_input( ) ) int( raw_input( ) ) q n = int( raw_input( ) ) int( raw_input( ) ) n
n = int( raw_input( ) )
t = [ int( val ) for val in raw_input( ).rstrip( ).split( " " ) ]
q = int( raw_input( ) )
s = [ int( val ) for val in raw_input( ).split( " " ) ]

cnt = 0
for si in s:
	for ti in t:
		if si == ti:
			cnt += 1
			break

print( cnt )