Buggy python submission (verdict: Time Limit Exceeded):
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
for i in t:
	for j in s:
		if int(i)==int(j):
			c +=1
			break
print(c)


Fixed submission:
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()

print(len(set(s)&set(t)))

Buggy python submission (verdict: Runtime Error):
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
for i in t:
	for j in s.sort():
		if int(i)==int(j):
			c +=1
			break
print(c)


Fixed submission:
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()

print(len(set(s)&set(t)))

Buggy python submission (verdict: Runtime Error):
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
for i in t:
	for j in s.sort():
		if int(i)==int(j):
			c +=1
			break
print(c)


Fixed submission:
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()

print(len(set(s)&set(t)))

Buggy python submission (verdict: Runtime Error):
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
for i in t:
	for j in s.sort():
		if int(i)==int(j):
			c +=1
			break
print(c)


Fixed submission:
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()

print(len(set(s)&set(t)))

Buggy python submission (verdict: Runtime Error):
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
l=s.sort()
for i in t:
	for j in l:
		if int(i)==int(j):
			c +=1
			break
print(c)


Fixed submission:
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()

print(len(set(s)&set(t)))

Buggy python submission (verdict: Time Limit Exceeded):
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()
for i in t:
	for j in s:
		if int(i)==int(j):
			c +=1
			break
print(c)


Fixed submission:
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()

print(len(set(s)&set(t)))

Buggy python submission (verdict: Runtime Error):
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()
for i in t:
	for j in s:
		if int(i)==int(j):
			c +=1
			break
print(c


Fixed submission:
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()

print(len(set(s)&set(t)))

Buggy python submission (verdict: Time Limit Exceeded):
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()
for i in t:
	for j in s:
		if int(i)==int(j):
			c +=1
			break
print(c)


Fixed submission:
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()

print(len(set(s)&set(t)))

Buggy python submission (verdict: Time Limit Exceeded):
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()
l=list(set(s))
for i in t:
	for j in l:
		if int(i)==int(j):
			c +=1
			break
print(c)


Fixed submission:
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()

print(len(set(s)&set(t)))

Buggy python submission (verdict: Time Limit Exceeded):
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
l=list(set(s))
l.sort()
for i in t:
	for j in l:
		if int(i)==int(j):
			c +=1
			break
print(c)


Fixed submission:
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()

print(len(set(s)&set(t)))

Buggy python submission (verdict: Time Limit Exceeded):
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()
for i in t:
	for j in s:
		if int(i)==int(j):
			c +=1
			break
print(c)


Fixed submission:
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()

print(len(set(s)&set(t)))

Buggy python submission (verdict: Runtime Error):
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()

print(len(set(s)&set(t))


Fixed submission:
c=0
n=int(input())
s=input().split()
q=int(input())
t=input().split()
s.sort()

print(len(set(s)&set(t)))