def linearSearch(S, T):
    n = 0
    for t in T:
        for s in S:
            if s == t:
                n += 1
                break
    return n

if __name__ == "__main__":
    input()
    S = raw_input().split()
    input()
    T = raw_input().split()
    print linearSearch(S, T) def linearSearch(S, T):
    n = 0
    for t in T:
        for s in S:
            if s == t:
                n += 1
                break
    return n linearSearch n = 0 n 0 for t in T:
        for s in S:
            if s == t:
                n += 1
                break
     t T for s in S:
            if s == t:
                n += 1
                break
     s S if s == t:
                n += 1
                break
     s == t s t n += 1 n 1 break return n n S S T T if __name__ == "__main__":
    input()
    S = raw_input().split()
    input()
    T = raw_input().split()
    print linearSearch(S, T) __name__ == "__main__" __name__ "__main__" input() input S = raw_input().split() S raw_input().split() ().split () raw_input split input() input T = raw_input().split() T raw_input().split() ().split () raw_input split print linearSearch(S, T) linearSearch S T S = raw_input().split() raw_input().split() S def linearSearch(S, T):
    n = 0
    for t in T:
        for s in S:
            if s == t:
                n += 1
                break
    return n def linearSearch(S, T):
    n = 0
    for t in T:
        for s in S:
            if s == t:
                n += 1
                break
    return n linearSearch T = raw_input().split() raw_input().split() T
def linearSearch(S, T):
    n = 0
    for t in T:
        for s in S:
            if s == t:
                n += 1
                break
    return n

if __name__ == "__main__":
    input()
    S = raw_input().split()
    input()
    T = raw_input().split()
    print linearSearch(S, T)