Buggy python submission (verdict: Time Limit Exceeded):
ns = int(raw_input())
s = raw_input().split()
nt = int(raw_input())
t = raw_input().split()
ans = 0
for i in t:
	if i in s: ans += 1
print ans

Fixed submission:
input()
l = raw_input().split()
input()
print len(set(l) & set(raw_input().split()))

Buggy python submission (verdict: Time Limit Exceeded):
ns = int(raw_input())
s = list(set(raw_input().split()))
nt = int(raw_input())
t = raw_input().split()
ans = 0
for i in t:
	if i in s: ans += 1
print ans

Fixed submission:
input()
l = raw_input().split()
input()
print len(set(l) & set(raw_input().split()))

Buggy python submission (verdict: Runtime Error):
tmp = raw_input()
s = map(int, list(set(raw_input().split())).sort())
tmp = raw_input()
t = map(int, raw_input().split().sort())

ans = 0

for i in t:
	i = 0
	while i <= s[i]
		if i == s[i]: ans+= 1
		i += 1
print ans

Fixed submission:
input()
l = raw_input().split()
input()
print len(set(l) & set(raw_input().split()))

Buggy python submission (verdict: Runtime Error):
tmp = raw_input()
s = map(int, list(set(raw_input().split())).sort())
tmp = raw_input()
t = map(int, raw_input().split().sort())

ans = 0

for i in t:
	i = 0
	while i <= s[i]:
		if i == s[i]: ans+= 1
		i += 1
print ans

Fixed submission:
input()
l = raw_input().split()
input()
print len(set(l) & set(raw_input().split()))

Buggy python submission (verdict: Runtime Error):
tmp = raw_input()
s = map(int, list(set(raw_input().split())).sort())
tmp = raw_input()
t = map(int, raw_input().split().sort())

ans = 0

for i in t:
	c = 0
	while i <= s[c]:
		if i == s[c]: ans+= 1
		c += 1
print ans

Fixed submission:
input()
l = raw_input().split()
input()
print len(set(l) & set(raw_input().split()))

Buggy python submission (verdict: Time Limit Exceeded):
tmp = raw_input()
s = list(set(map(int, raw_input().split())))
tmp = raw_input()
t = sorted(map(int, raw_input().split()))

max_n = s[-1]
ans = 0

for i in t:
	for j in range(len(s)):
		if i == s[j]:
			ans += 1
			break
		elif i <= s[j]:
			break
print ans

Fixed submission:
input()
l = raw_input().split()
input()
print len(set(l) & set(raw_input().split()))

Buggy python submission (verdict: Time Limit Exceeded):
tmp = raw_input()
s = list(set(map(int, raw_input().split())))
tmp = raw_input()
t = sorted(map(int, raw_input().split()))

max_n = s[-1]
min_n = s[0]
ans = 0

for i in t:
	if i > max_n or i < min_n: continue
	for j in range(len(s)):
		if i == s[j]:
			ans += 1
			break
		elif i <= s[j]:
			break
print ans

Fixed submission:
input()
l = raw_input().split()
input()
print len(set(l) & set(raw_input().split()))

Buggy python submission (verdict: Runtime Error):
tmp = raw_input()
s = list(set(map(int, raw_input().split())))
tmp = raw_input()
t = sorted(map(int, raw_input().split()))

max_n = s[-1]
min_n = s[0]
ans = 0

for i in t:
	if i > max_n or i < min_n: continue
	for j in range(len(s)):
		if i == s[j]:
			s = s[index(j):]
			ans += 1
			break
		elif i <= s[j]:
			break
print ans

Fixed submission:
input()
l = raw_input().split()
input()
print len(set(l) & set(raw_input().split()))

Buggy python submission (verdict: Time Limit Exceeded):
tmp = raw_input()
s = list(set(map(int, raw_input().split())))
tmp = raw_input()
t = sorted(map(int, raw_input().split()))

max_n = s[-1]
min_n = s[0]
ans = 0

for i in t:
	if i > max_n or i < min_n: continue
	for j in range(len(s)):
		if i == s[j]:
			s = s[s.index(j):]
			ans += 1
			break
		elif i <= s[j]:
			break
print ans

Fixed submission:
input()
l = raw_input().split()
input()
print len(set(l) & set(raw_input().split()))