Sum all value in multiple database fields

Ah so if I understand correctly you need to understand how many times the user clicks D and the same for all the other letters, right?

Well to do this you would do much earlier to use the numeric fields in the database, so that each time one selects D it adds 1 to the item in the database and in the end you will not need to count the characters, but you will have the number.

As you have structured now the database is more complex, since the filters work by rows not by columns, so you looking for the user should retrieve all the letters that the user has chosen, put them inside an array with a loop and then count the elements inside the array with .lenght ()