# -*- coding:utf-8 -*-
import sys


def liner_search(data, targets):
    cnt = 0
    for num in targets:
        if num in data:
            cnt += 1
    return cnt


if __name__ == "__main__":
    data = [val.split() for val in sys.stdin.read().splitlines()]
    print(liner_search(data[1], data[3])) import sys sys def liner_search(data, targets):
    cnt = 0
    for num in targets:
        if num in data:
            cnt += 1
    return cnt liner_search cnt = 0 cnt 0 for num in targets:
        if num in data:
            cnt += 1
     num targets if num in data:
            cnt += 1
     num in data num data cnt += 1 cnt 1 return cnt cnt data data targets targets if __name__ == "__main__":
    data = [val.split() for val in sys.stdin.read().splitlines()]
    print(liner_search(data[1], data[3])) __name__ == "__main__" __name__ "__main__" val.split() for val in sys.stdin.read().splitlines() for val in sys.stdin.read().splitlines() val sys.stdin.read().splitlines() sys.stdin.read().splitlines sys.stdin.read() sys.stdin.read sys.stdin sys stdin read splitlines for val in sys.stdin.read().splitlines() val.split() val.split val split data = [val.split() for val in sys.stdin.read().splitlines()] data [val.split() for val in sys.stdin.read().splitlines()] print(liner_search(data[1], data[3])) print liner_search(data[1], data[3]) liner_search data[1] data 1 data[3] data 3 def liner_search(data, targets):
    cnt = 0
    for num in targets:
        if num in data:
            cnt += 1
    return cnt def liner_search(data, targets):
    cnt = 0
    for num in targets:
        if num in data:
            cnt += 1
    return cnt liner_search data = [val.split() for val in sys.stdin.read().splitlines()] [val.split() for val in sys.stdin.read().splitlines()] data
# -*- coding:utf-8 -*-
import sys


def liner_search(data, targets):
    cnt = 0
    for num in targets:
        if num in data:
            cnt += 1
    return cnt


if __name__ == "__main__":
    data = [val.split() for val in sys.stdin.read().splitlines()]
    print(liner_search(data[1], data[3]))