command help

i am trying to build a command that searches a text file
and outputs the number of words which consists of two 'b' characters
in each word separatly

like
barby

(the b characters must be separated from one another)
i tried to use grep [b][b]filepath
then i know that we need to use pipe to count the result

but it prints all the word with the two b chars
one next to the other

i am trying to build a command that searches a text file
and outputs the number words which consists of two 'x' characters
only
i tried to use

i can count them with wc but i cant figure out
how to filter out the undesirable words

how to construct these commands

kinda looks like school work.

let me give you one hint.
search on the internet for regular expressions.