Based on octet rule, elements would fill up their outermost shell with 8 electrons to be stable. In this case, Carbon has 4 valence on its outer shell, Hydrogen has only 1 valence, while Bromine has 7. Therefore the total valence electrons are:
total valence = 4*4 + 1*6 + 7*2 = 16 + 6 + 14
total valence = 36