Having trouble getting the correct answer.

There are four rows containing the following data in the range of B5:T5.

x x - - x x - - - - - - - -

- - x - - x x - - - x - - -

This is what I've got in column V5 =COUNTIF(B5:T18,"x")
This is what I've got in column V7 =COUNTIF(B7:T20,"x")

The following is the result I'm getting.

x x - - x x - - - - - - - - 8

- - x - - x x - - - x - - - 4

The 8 should only be 4. What am I doing wrong?