I have the following Excel table:
vr59h2.png

I want to see how many numbers (not how many times) from the first row appear in the last two rows.

I tried to sum each countif for each number from the first row in the range area of these last two rows.
It doesn't work.

If I try to countif for 40, as you see in image, it shows to me 2 because it appears two times: one on the row and the other on the last row. It should say to me only 1.
Then if I try to do the same for every number in the first row it should give to me for each one of them 0 or 1. Just 0 or 1.
Then, finally added all together in order to find out how many numbers (not how many times) from the first row appear in the last two rows.

Help me, please.

Thank you so much !