def linearSearch(S, key):
    i = 0
    S.append(key)
    while S[i] != key:
        i += 1
    if i == len(S)-1:
        return False
    return True

def main():
    n = int(raw_input())
    S = [int(_) for _ in raw_input().split()]
    q = int(raw_input())
    T = [int(_) for _ in raw_input().split()]
    Sum = 0
    for t in T:
        if linearSearch(S[:], t): Sum += 1
    print Sum
    return 0

main() def linearSearch(S, key):
    i = 0
    S.append(key)
    while S[i] != key:
        i += 1
    if i == len(S)-1:
        return False
    return True linearSearch i = 0 i 0 S.append(key) S.append S append key while S[i] != key:
        i += 1
     S[i] != key S[i] S i key i += 1 i 1 if i == len(S)-1:
        return False
     i == len(S)-1 i len(S)-1 len(S) len S 1 return False False return True True S S key key def main():
    n = int(raw_input())
    S = [int(_) for _ in raw_input().split()]
    q = int(raw_input())
    T = [int(_) for _ in raw_input().split()]
    Sum = 0
    for t in T:
        if linearSearch(S[:], t): Sum += 1
    print Sum
    return 0 main n = int(raw_input()) n int(raw_input()) int raw_input() raw_input int(_) for _ in raw_input().split() for _ in raw_input().split() _ raw_input().split() ().split () raw_input split for _ in raw_input().split() int(_) int _ S = [int(_) for _ in raw_input().split()] S [int(_) for _ in raw_input().split()] q = int(raw_input()) q int(raw_input()) int raw_input() raw_input int(_) for _ in raw_input().split() for _ in raw_input().split() _ raw_input().split() ().split () raw_input split for _ in raw_input().split() int(_) int _ T = [int(_) for _ in raw_input().split()] T [int(_) for _ in raw_input().split()] Sum = 0 Sum 0 for t in T:
        if linearSearch(S[:], t): Sum += 1
     t T if linearSearch(S[:], t): Sum += 1
     linearSearch(S[:], t) linearSearch S[:] S : t print return 0 0 main() main def main():
    n = int(raw_input())
    S = [int(_) for _ in raw_input().split()]
    q = int(raw_input())
    T = [int(_) for _ in raw_input().split()]
    Sum = 0
    for t in T:
        if linearSearch(S[:], t): Sum += 1
    print Sum
    return 0 def main():
    n = int(raw_input())
    S = [int(_) for _ in raw_input().split()]
    q = int(raw_input())
    T = [int(_) for _ in raw_input().split()]
    Sum = 0
    for t in T:
        if linearSearch(S[:], t): Sum += 1
    print Sum
    return 0 main def linearSearch(S, key):
    i = 0
    S.append(key)
    while S[i] != key:
        i += 1
    if i == len(S)-1:
        return False
    return True def linearSearch(S, key):
    i = 0
    S.append(key)
    while S[i] != key:
        i += 1
    if i == len(S)-1:
        return False
    return True linearSearch
def linearSearch(S, key):
    i = 0
    S.append(key)
    while S[i] != key:
        i += 1
    if i == len(S)-1:
        return False
    return True

def main():
    n = int(raw_input())
    S = [int(_) for _ in raw_input().split()]
    q = int(raw_input())
    T = [int(_) for _ in raw_input().split()]
    Sum = 0
    for t in T:
        if linearSearch(S[:], t): Sum += 1
    print Sum
    return 0

main()