This is a numerical-answer question. The correct answer is shown below.
[Solution by Dr. Abubacker] $B$ takes the $-2$ state, which means it needs 2 electrons to complete its octet. So it has 6 electrons in its valence shell (a group 16 element, e.g. O in $\text{Na}_2\text{O}$). Answer: 6.