# 개수세기

n = int(input())
data = list(map(int, input().split()))
v = int(input())

result = 0
for i in data:
    if i == v:
        result+=1
print(result)

d8f8d889d7e542c13b1d1c75445243f4569d063c
<mask token>

<mask token>
for i in data:
    if i == v:
        result += 1
print(result)

n = int(input())
data = list(map(int, input().split()))
v = int(input())
result = 0
for i in data:
    if i == v:
        result += 1
print(result)

# 개수세기

n = int(input())
data = list(map(int, input().split()))
v = int(input())

result = 0
for i in data:
    if i == v:
        result+=1
print(result)
