This answer is incorrect. You probably forgot to multiply the number of bonded electrons by 1/2 in the following expression.

formal charge = group # - 1/2(bonded electrons) - non-bonded electrons

Remember that the bonded electrons are "shared".