We know that there were 13 M&Ms in total.
Where r represents red M&Ms, and b represents brown M&Ms.
"There was one more red M&M than brown M&M", we can express this as
Then, we combine the equations we've got to solve for b
Then, we find r
Hence, there were 6 brown M&Ms and 7 red M&Ms.