I have two lists of names in separate columns, for example:

A
Mary
Tom
Jim
Bob
Ben

B
Tom
Mary
Sean
Geoff
Ben


Is there a formula I can use to output the count of names in Column B that appear in Column A? Been trying the Countif function but not sure if that is correct

So in this case the output would be 3.