def happiness(A, B, n):
	return sum(x in n for x in A) - sum(x in n for x in B)

def get_data(prompt=""):
	return [int(x) for x in input(prompt).split()]

def test(A, B, n, expected):
	print(f"A={A} B={B} n={n}")
	r = happiness(A, B, n)
	success = "SUCCESS" if r == expected else "FAILURE"
	print(f"{success}: r={r} expected={expected}")

test([1, 2, 4], [1, 3, 5], [3], -1)
test([1, 2, 4], [1, 3, 5], [2], 1)
test([1, 2, 4], [1, 3, 5], [1, 2, 4, 5], 1)

print("------")
print(happiness(get_data(), get_data(), get_data()))
