class Sequence:
    def __init__(self,num, seq):
        self.n = num
        self.sequence = seq

def LinearSearch(A, n, key):
    i=0
    A[n] = key
    while A[i] != key:
        i += 1
    if i==n:
        return "NOT_FOUND"
    return i

if __name__ == "__main__":

    n = int(raw_input())
    x =	map(int, raw_input().split())
    x.append(" ")
    A = Sequence(n, x)
    n =	int(raw_input())
    x =	map(int, raw_input().split())
    x.append(" ")
    B = Sequence(n, x)

    C_num = 0

    for i in range(B.n):
        res = LinearSearch(A.sequence, A.n, B.sequence[i])
        if res != "NOT_FOUND":
            C_num += 1

    print(C_num) class Sequence:
    def __init__(self,num, seq):
        self.n = num
        self.sequence = seq Sequence def __init__(self,num, seq):
        self.n = num
        self.sequence = seq __init__ self.n = num self.n self n num self.sequence = seq self.sequence self sequence seq self self num num seq seq def LinearSearch(A, n, key):
    i=0
    A[n] = key
    while A[i] != key:
        i += 1
    if i==n:
        return "NOT_FOUND"
    return i LinearSearch i=0 i 0 A[n] = key A[n] A n key while A[i] != key:
        i += 1
     A[i] != key A[i] A i key i += 1 i 1 if i==n:
        return "NOT_FOUND"
     i==n i n return "NOT_FOUND" "NOT_FOUND" return i i A A n n key key if __name__ == "__main__":

    n = int(raw_input())
    x =	map(int, raw_input().split())
    x.append(" ")
    A = Sequence(n, x)
    n =	int(raw_input())
    x =	map(int, raw_input().split())
    x.append(" ")
    B = Sequence(n, x)

    C_num = 0

    for i in range(B.n):
        res = LinearSearch(A.sequence, A.n, B.sequence[i])
        if res != "NOT_FOUND":
            C_num += 1

    print(C_num) __name__ == "__main__" __name__ "__main__" n = int(raw_input()) n int(raw_input()) int raw_input() raw_input x =	map(int, raw_input().split()) x map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split x.append(" ") x.append x append " " A = Sequence(n, x) A Sequence(n, x) Sequence n x n =	int(raw_input()) n int(raw_input()) int raw_input() raw_input x =	map(int, raw_input().split()) x map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split x.append(" ") x.append x append " " B = Sequence(n, x) B Sequence(n, x) Sequence n x C_num = 0 C_num 0 for i in range(B.n):
        res = LinearSearch(A.sequence, A.n, B.sequence[i])
        if res != "NOT_FOUND":
            C_num += 1

     i range(B.n) range B.n B n res = LinearSearch(A.sequence, A.n, B.sequence[i]) res LinearSearch(A.sequence, A.n, B.sequence[i]) LinearSearch A.sequence A sequence A.n A n B.sequence[i] B.sequence B sequence i if res != "NOT_FOUND":
            C_num += 1

     res != "NOT_FOUND" res "NOT_FOUND" C_num += 1 C_num 1 print(C_num) print C_num n =	int(raw_input()) int(raw_input()) n res = LinearSearch(A.sequence, A.n, B.sequence[i]) LinearSearch(A.sequence, A.n, B.sequence[i]) res C_num += 1 1 C_num B = Sequence(n, x) Sequence(n, x) B def LinearSearch(A, n, key):
    i=0
    A[n] = key
    while A[i] != key:
        i += 1
    if i==n:
        return "NOT_FOUND"
    return i def LinearSearch(A, n, key):
    i=0
    A[n] = key
    while A[i] != key:
        i += 1
    if i==n:
        return "NOT_FOUND"
    return i LinearSearch class Sequence:
    def __init__(self,num, seq):
        self.n = num
        self.sequence = seq class Sequence:
    def __init__(self,num, seq):
        self.n = num
        self.sequence = seq Sequence n = int(raw_input()) int(raw_input()) n x =	map(int, raw_input().split()) map(int, raw_input().split()) x C_num = 0 0 C_num x =	map(int, raw_input().split()) map(int, raw_input().split()) x A = Sequence(n, x) Sequence(n, x) A
class Sequence:
    def __init__(self,num, seq):
        self.n = num
        self.sequence = seq

def LinearSearch(A, n, key):
    i=0
    A[n] = key
    while A[i] != key:
        i += 1
    if i==n:
        return "NOT_FOUND"
    return i

if __name__ == "__main__":

    n = int(raw_input())
    x =	map(int, raw_input().split())
    x.append(" ")
    A = Sequence(n, x)
    n =	int(raw_input())
    x =	map(int, raw_input().split())
    x.append(" ")
    B = Sequence(n, x)

    C_num = 0

    for i in range(B.n):
        res = LinearSearch(A.sequence, A.n, B.sequence[i])
        if res != "NOT_FOUND":
            C_num += 1

    print(C_num)